Merge pull request #411 from BelleNottelling/cleanup-exception-spam

This commit is contained in:
Yağızhan authored and GitHub committed 2022-10-31 09:26:39 +03:00
commit 4c6647c5bf
3 files changed
+7 -9

No files matched your search

+3 -1
View File
@@ -19,7 +19,9 @@ class Box_AppAdmin extends Box_App
{
$m = $this->di['mod']($this->mod);
$controller = $m->getAdminController();
$controller->register($this);
if(!is_null($controller)){
$controller->register($this);
}
}
public function render($fileName, $variableArray = [])
+1 -1
View File
@@ -165,7 +165,7 @@ class Box_Mod
public function getAdminController()
{
if(!$this->hasAdminController()) {
throw new \Box_Exception('Module :mod Admin controller class was not found', array(':mod'=>$this->mod));
return null;
}
$class = 'Box\\Mod\\'.ucfirst($this->mod).'\\Controller\\Admin';
$service = new $class();
+3 -7
View File
@@ -246,14 +246,10 @@ class Service implements InjectionAwareInterface
if (!$staff_service->hasPermission($admin, $mod)) {
continue;
}
$m = $this->di['mod']($mod);
$obj = $m->getAdminController();
try {
$m = $this->di['mod']($mod);
$obj = $m->getAdminController();
} catch (\Exception $e) {
continue;
}
if (method_exists($obj, 'fetchNavigation')) {
if (!is_null($obj) && method_exists($obj, 'fetchNavigation')) {
$n = $obj->fetchNavigation();
if (isset($n['group'])) {