modules: Fix that the forms namespace is not registered when the module does not have any library file
This commit is contained in:
parent
4971037b37
commit
b983f1901b
|
@ -759,15 +759,15 @@ class Module
|
|||
protected function registerAutoloader()
|
||||
{
|
||||
$moduleName = ucfirst($this->getName());
|
||||
|
||||
$moduleLibraryDir = $this->getLibDir(). '/'. $moduleName;
|
||||
if (is_dir($this->getBaseDir()) && is_dir($this->getLibDir()) && is_dir($moduleLibraryDir)) {
|
||||
if (is_dir($moduleLibraryDir)) {
|
||||
$this->app->getLoader()->registerNamespace('Icinga\\Module\\' . $moduleName, $moduleLibraryDir);
|
||||
if (is_dir($this->getFormDir())) {
|
||||
$this->app->getLoader()->registerNamespace(
|
||||
'Icinga\\Module\\' . $moduleName. '\\Forms',
|
||||
$this->getFormDir()
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
$moduleFormDir = $this->getFormDir();
|
||||
if (is_dir($moduleFormDir)) {
|
||||
$this->app->getLoader()->registerNamespace('Icinga\\Module\\' . $moduleName. '\\Forms', $moduleFormDir);
|
||||
}
|
||||
|
||||
return $this;
|
||||
|
|
Loading…
Reference in New Issue