MAJ en Thelia 2.3.4
This commit is contained in:
@@ -84,6 +84,12 @@ class Module extends BaseAction implements EventSubscriberInterface
|
||||
if (null !== $module = ModuleQuery::create()->findPk($event->getModuleId())) {
|
||||
try {
|
||||
if ($module->getActivate() == BaseModule::IS_ACTIVATED) {
|
||||
if ($module->getMandatory() == BaseModule::IS_MANDATORY && $event->getAssumeDeactivate() === false) {
|
||||
throw new \Exception(
|
||||
Translator::getInstance()->trans('Can\'t deactivate a secure module')
|
||||
);
|
||||
}
|
||||
|
||||
if ($event->isRecursive()) {
|
||||
$this->recursiveDeactivation($event, $eventName, $dispatcher);
|
||||
}
|
||||
@@ -233,6 +239,11 @@ class Module extends BaseAction implements EventSubscriberInterface
|
||||
}
|
||||
|
||||
try {
|
||||
if ($module->getMandatory() == BaseModule::IS_MANDATORY && $event->getAssumeDelete() === false) {
|
||||
throw new \Exception(
|
||||
Translator::getInstance()->trans('Can\'t remove a core module')
|
||||
);
|
||||
}
|
||||
// First, try to create an instance
|
||||
$instance = $module->createInstance();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user