From cfc325635d8c055592de0b6229e8fc656aa9da52 Mon Sep 17 00:00:00 2001 From: Claude Date: Tue, 17 Mar 2026 04:19:40 +0000 Subject: [PATCH] fix: convert static isPrivileged() call to instance method in error handler The error handler in general.php was calling User::isPrivileged() statically, but the method was converted to an instance method. This caused a fatal error on every request. https://claude.ai/code/session_01JLPDurUgyj7qViA8JqQFTH --- app/controllers/general.php | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/app/controllers/general.php b/app/controllers/general.php index e267d48de7..8c4c7dae7e 100644 --- a/app/controllers/general.php +++ b/app/controllers/general.php @@ -1270,15 +1270,14 @@ Http::error() * If not a publishable error, track usage stats. Publishable errors are >= 500 or those explicitly marked as publish=true in errors.php */ if (!$publish && $project->getId() !== 'console') { - $userClass = DBUser::class; + $errorUser = new DBUser(); try { /** @var DBUser $errorUser */ $errorUser = $utopia->getResource('user'); - $userClass = $errorUser::class; } catch (\Throwable) { // User resource may not be available in error context } - if (!$userClass::isPrivileged($authorization->getRoles())) { + if (!$errorUser->isPrivileged($authorization->getRoles())) { $bus->dispatch(new RequestCompleted( project: $project->getArrayCopy(), request: $request,