Commit 96e7a89c authored by Tino Goratsch's avatar Tino Goratsch

restrict the ServiceContainerBuilder to only use the currently insatlled AND active modules

parent 72f60f08
......@@ -87,7 +87,7 @@ class ServiceContainerBuilder extends ContainerBuilder
// Try to get all available services
/** @var Modules $modules */
$modules = $this->get('core.modules');
$availableModules = ($this->allModules === true) ? $modules->getAllModules() : $modules->getInstalledModules();
$availableModules = ($this->allModules === true) ? $modules->getAllModules() : $modules->getActiveModules();
$vendors = $this->get('core.modules.vendors')->getVendors();
foreach ($availableModules as $module) {
......
......@@ -122,7 +122,7 @@ class Modules
}
/**
* Checks, whether a modules in currently installed or not
* Checks, whether a module is currently installed or not
*
* @param string $moduleName
*
......
......@@ -80,13 +80,13 @@ class LinkModeValidationRule extends AbstractValidationRule
{
switch ($mode) {
case 1:
return $this->modules->isInstalled($moduleName);
return $this->modules->isActive($moduleName);
case 2:
return $this->internalUriValidationRule->isValid($uri);
case 3:
return !empty($uri);
case 4:
if ($this->modules->isInstalled('articles')) {
if ($this->modules->isActive('articles')) {
return $this->articleExistsValidationRule->isValid($articleId);
}
}
......
......@@ -110,7 +110,6 @@ class Modules extends Core\Controller\AbstractAdminAction
$bool = $this->saveModuleState($moduleDirectory, 1);
$this->renewCaches();
$this->purgeCaches();
$text = $this->translator->t(
......@@ -169,6 +168,7 @@ class Modules extends Core\Controller\AbstractAdminAction
{
Core\Cache\Purge::doPurge([
$this->appPath->getCacheDir() . 'http',
$this->appPath->getCacheDir() . 'sql',
$this->appPath->getCacheDir() . 'tpl_compiled',
$this->appPath->getCacheDir() . 'tpl_cached',
$this->appPath->getCacheDir() . 'container.php',
......@@ -208,7 +208,6 @@ class Modules extends Core\Controller\AbstractAdminAction
$bool = $this->saveModuleState($moduleDirectory, 0);
$this->renewCaches();
$this->purgeCaches();
$text = $this->translator->t(
......@@ -251,7 +250,6 @@ class Modules extends Core\Controller\AbstractAdminAction
$bool = $container->get('core.modules.schemaInstaller')->install($moduleSchema);
$bool2 = $container->get('core.modules.aclInstaller')->install($moduleSchema);
$this->renewCaches();
$this->purgeCaches();
$text = $this->translator->t(
......@@ -283,7 +281,7 @@ class Modules extends Core\Controller\AbstractAdminAction
}
$serviceId = strtolower($moduleDirectory . '.installer.schema');
$container = $this->installerHelper->updateServiceContainer($this->request);
$container = $this->installerHelper->updateServiceContainer($this->request, true);
$this->moduleInstallerExists($container, $serviceId);
/** @var Core\Modules\Installer\SchemaInterface $moduleSchema */
......@@ -298,7 +296,6 @@ class Modules extends Core\Controller\AbstractAdminAction
$bool = $this->container->get('core.modules.schemaInstaller')->uninstall($moduleSchema);
$bool2 = $this->container->get('core.modules.aclInstaller')->uninstall($moduleSchema);
$this->renewCaches();
$this->purgeCaches();
$text = $this->translator->t(
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment