Skip to content

Commit

Permalink
Merge pull request #14693 from snipe/fixes/14692_view_share_undefined
Browse files Browse the repository at this point in the history
Fixes #14692 - set default variables for sidebar totals
  • Loading branch information
snipe committed May 7, 2024
2 parents fd929f5 + 4f12c86 commit 3084521
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions app/Http/Middleware/AssetCountForSidebar.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,14 @@ class AssetCountForSidebar
*/
public function handle($request, Closure $next)
{
/**
* This needs to be set for the /setup process, since the tables might not exist yet
*/
$total_due_for_checkin = 0;
$total_overdue_for_checkin = 0;
$total_due_for_audit = 0;
$total_overdue_for_audit = 0;

try {
$total_rtd_sidebar = Asset::RTD()->count();
view()->share('total_rtd_sidebar', $total_rtd_sidebar);
Expand Down

0 comments on commit 3084521

Please sign in to comment.