- Issue created by @mglaman
- πΊπΈUnited States mglaman WI, USA
Note: it should also implement DestructableInterface so that invalidation happens as late as possible
final class ConfigSubscriber implements EventSubscriberInterface, DestructableInterface { private bool $shouldInvalidate = FALSE; public static function getSubscribedEvents(): array { $events[ConfigEvents::SAVE][] = ['onSave']; return $events; } public function onSave(ConfigCrudEvent $event): void { $config = $event->getConfig(); if ($config->getName() === 'cors_ui.configuration' && $config->get() !== $config->getOriginal()) { $this->shouldInvalidate = TRUE; } } public function destruct() { if ($this->shouldInvalidate) { $this->drupalKernel->rebuildContainer(); // @todo remove after https://www.drupal.org/project/cors_ui/issues/3405064 Cache::invalidateTags(['http_response']); } }
- Merge request !7Invalidate service container when configuration changes β (Merged) created by mglaman
- last update
7 months ago 2 fail - Status changed to Needs review
7 months ago 8:21pm 5 April 2024 - Status changed to Needs work
7 months ago 2:03pm 9 April 2024 - Status changed to Needs review
7 months ago 2:23pm 9 April 2024 -
mglaman β
committed d08ed282 on 8.x-1.x
Issue #3405046: Move container rebuild to configuration subscriber
-
mglaman β
committed d08ed282 on 8.x-1.x
- Status changed to Fixed
7 months ago 3:12pm 9 April 2024 Automatically closed - issue fixed for 2 weeks with no activity.