Skip to content

Commit

Permalink
Fixes #14692 - set default variables for sidebar totals
Browse files Browse the repository at this point in the history
Signed-off-by: snipe <[email protected]>
  • Loading branch information
snipe committed May 7, 2024
1 parent fd929f5 commit 4f12c86
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 4f12c86

Please sign in to comment.