diff --git a/core/lib/Thelia/Action/Module.php b/core/lib/Thelia/Action/Module.php index 18fdb85cb..5025c513f 100644 --- a/core/lib/Thelia/Action/Module.php +++ b/core/lib/Thelia/Action/Module.php @@ -23,6 +23,7 @@ namespace Thelia\Action; use Symfony\Component\EventDispatcher\EventSubscriberInterface; +use Thelia\Core\Event\Cache\CacheEvent; use Thelia\Core\Event\Module\ModuleToggleActivationEvent; use Thelia\Core\Event\TheliaEvents; use Thelia\Model\ModuleQuery; @@ -56,9 +57,18 @@ class Module extends BaseAction implements EventSubscriberInterface if($module->isModified()) { $event->setModule($module); } + + $this->cacheClear(); } } + protected function cacheClear() + { + $cacheEvent = new CacheEvent($this->container->getParameter('kernel.cache_dir')); + + $this->getDispatcher()->dispatch(TheliaEvents::CACHE_CLEAR, $cacheEvent); + } + /** * Returns an array of event names this subscriber wants to listen to. *