Merge pull request #14693 from snipe/fixes/14692_view_share_undefined

Fixes #14692 - set default variables for sidebar totals
This commit is contained in:
snipe 2024-05-07 08:37:10 +01:00 committed by GitHub
commit 3084521521
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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);