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;