From 4f12c86e741debaa36cd609a1fe4b9a6d30ac93b Mon Sep 17 00:00:00 2001 From: snipe Date: Tue, 7 May 2024 08:34:22 +0100 Subject: [PATCH] Fixes #14692 - set default variables for sidebar totals Signed-off-by: snipe --- app/Http/Middleware/AssetCountForSidebar.php | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/app/Http/Middleware/AssetCountForSidebar.php b/app/Http/Middleware/AssetCountForSidebar.php index 2bc3f950f9..e529f75efa 100644 --- a/app/Http/Middleware/AssetCountForSidebar.php +++ b/app/Http/Middleware/AssetCountForSidebar.php @@ -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);