From 74d5a3c10617e1b2bd6ee216a288c60f279fe576 Mon Sep 17 00:00:00 2001 From: Tiddo Date: Sat, 2 Nov 2024 20:04:35 +0100 Subject: [PATCH] Fix for broken API --- .../Controller/ActionController/ApiController.php | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/module/ApiBundle/Component/Controller/ActionController/ApiController.php b/module/ApiBundle/Component/Controller/ActionController/ApiController.php index 7ab1e2ee5..10851eff3 100644 --- a/module/ApiBundle/Component/Controller/ActionController/ApiController.php +++ b/module/ApiBundle/Component/Controller/ActionController/ApiController.php @@ -101,18 +101,14 @@ public function onDispatch(MvcEvent $e) ) ) { $error = $this->error(401, 'You do not have sufficient permissions to access this resource'); - if ($result instanceof \Laminas\View\Model\ViewModel) { - $error->setOptions($result->getOptions()); - } + $error->setOptions($result->getOptions()); $e->setResult($error); return $error; } } else { $error = $this->error(401, 'No key or OAuth token was provided or the token was invalid'); - if ($result instanceof \Laminas\View\Model\ViewModel) { - $error->setOptions($result->getOptions()); - } + $error->setOptions($result->getOptions()); $e->setResult($error); return $error;