From 058bcb083dcf7d593f0a005cc657da859e5891f3 Mon Sep 17 00:00:00 2001 From: Thomas Gelf Date: Mon, 21 Aug 2017 08:04:29 +0200 Subject: [PATCH] NotificationController: fix method signature --- application/controllers/NotificationController.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/application/controllers/NotificationController.php b/application/controllers/NotificationController.php index a5f3a0b1..f43651f4 100644 --- a/application/controllers/NotificationController.php +++ b/application/controllers/NotificationController.php @@ -15,10 +15,12 @@ class NotificationController extends ObjectController $this->assertPermission('director/notifications'); } + // TODO: KILL IT public function init() { parent::init(); // TODO: Check if this is still needed, remove it otherwise + /** @var \Icinga\Web\Widget\Tab $tab */ if ($this->object && $this->object->object_type === 'apply') { if ($host = $this->params->get('host')) { foreach ($this->getTabs()->getTabs() as $tab) { @@ -37,8 +39,12 @@ class NotificationController extends ObjectController /** * @param DirectorObjectForm $form */ - protected function onObjectFormLoaded($form) + protected function onObjectFormLoaded(DirectorObjectForm $form) { + if (! $this->object) { + return; + } + if ($this->object->isTemplate()) { $form->setListUrl('director/notifications/templates'); } else {