diff --git a/Core/ModuleStateFixer.php b/Core/ModuleStateFixer.php index edc09d8..2564842 100644 --- a/Core/ModuleStateFixer.php +++ b/Core/ModuleStateFixer.php @@ -272,7 +272,8 @@ private function restoreModuleInformation($module, $moduleId) if (version_compare($metaDataVersion, '2.0', '>=')) { try { - $this->setModuleControllers($module->getControllers(), $moduleId, $module); + $moduleControllers = $module->isActive() ? $module->getControllers() : []; + $this->setModuleControllers($moduleControllers, $moduleId, $module); } catch (ModuleValidationException $exception) { print "[ERROR]: duplicate controllers:" . $exception->getMessage() ."\n"; } @@ -330,18 +331,20 @@ protected function setModuleControllers($moduleControllers, $moduleId, $module) $controllersForThatModuleInDb = $this->getModuleControllerEntries($moduleId); $duplicatedKeys = array_intersect_key($moduleControllers, $controllersForThatModuleInDb); - $diff = array_diff_assoc($moduleControllers,$duplicatedKeys); + $diff = array_diff_assoc($moduleControllers, $duplicatedKeys); if ($diff) { $this->output->writeLn("$moduleId fixing module controllers (in md):" . var_export($moduleControllers, true)); $this->output->writeLn("$moduleId fixing module controllers (in db):" . var_export($controllersForThatModuleInDb, true)); $this->deleteModuleControllers($moduleId); $this->resetModuleCache($module); - $this->validateModuleMetadataControllersOnActivation($moduleControllers); + if ($moduleControllers) { + $this->validateModuleMetadataControllersOnActivation($moduleControllers); - $classProviderStorage = $this->getClassProviderStorage(); + $classProviderStorage = $this->getClassProviderStorage(); - $classProviderStorage->add($moduleId, $moduleControllers); + $classProviderStorage->add($moduleId, $moduleControllers); + } $this->needCacheClear = true; } diff --git a/metadata.php b/metadata.php index f948ffd..26fa0c1 100644 --- a/metadata.php +++ b/metadata.php @@ -49,7 +49,7 @@ Komplette Übersicht: '.$sLinkAndText, ], 'thumbnail' => 'module_internals.png', - 'version' => '1.5.0', + 'version' => '1.5.1', 'author' => 'OXID Community', 'url' => 'https://github.com/OXIDprojects/oxid-module-internals', 'email' => '',