From e83526be084be9d61dbee372f5ac0de5dac0f347 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jannis=20Mo=C3=9Fhammer?= Date: Mon, 15 Jul 2013 13:37:43 +0200 Subject: [PATCH] Make form folder optional When the form folder didn't exist, an exception was thrown that froze the frontend without any error message. Now it is tested whether the form folder in a module is available and only registered in the auotoloader if so. refs #4407 --- library/Icinga/Application/Modules/Module.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/library/Icinga/Application/Modules/Module.php b/library/Icinga/Application/Modules/Module.php index af9d62796..260e874fb 100644 --- a/library/Icinga/Application/Modules/Module.php +++ b/library/Icinga/Application/Modules/Module.php @@ -227,8 +227,9 @@ class Module $moduleLibraryDir = $this->getLibDir(). '/'. $moduleName; $this->app->getLoader()->registerNamespace($moduleName, $moduleLibraryDir); - - $this->app->getLoader()->registerNamespace($moduleName. '\\Form', $this->getFormDir()); + if (is_dir($this->getFormDir())) { + $this->app->getLoader()->registerNamespace($moduleName. '\\Form', $this->getFormDir()); + } } return $this;