core/core.services.yml | 4 ++-- core/lib/Drupal/Core/Config/ConfigInstaller.php | 15 +++++++++++++-- 2 files changed, 15 insertions(+), 4 deletions(-) diff --git a/core/core.services.yml b/core/core.services.yml index 880c561..bd8660d 100644 --- a/core/core.services.yml +++ b/core/core.services.yml @@ -137,7 +137,7 @@ services: arguments: ['@config.storage', '@event_dispatcher', '@config.typed', '@cache_tags.invalidator'] config.installer: class: Drupal\Core\Config\ConfigInstaller - arguments: ['@config.factory', '@config.storage', '@config.typed', '@config.manager', '@event_dispatcher'] + arguments: ['@config.factory', '@config.storage', '@config.typed', '@config.manager', '@event_dispatcher', '@cache_tags.invalidator'] config.storage: class: Drupal\Core\Config\CachedStorage arguments: ['@config.storage.active', '@cache.config'] @@ -402,7 +402,7 @@ services: arguments: ['@plugin.manager.menu.link'] menu.tree_storage: class: Drupal\Core\Menu\MenuTreeStorage - arguments: ['@database', '@cache.menu', 'menu_tree'] + arguments: ['@database', '@cache.menu', '@cache_tags.invalidator', 'menu_tree'] public: false # Private to plugin.manager.menu.link and menu.link_tree tags: - { name: backend_overridable } diff --git a/core/lib/Drupal/Core/Config/ConfigInstaller.php b/core/lib/Drupal/Core/Config/ConfigInstaller.php index 72ae554..7f9207b 100644 --- a/core/lib/Drupal/Core/Config/ConfigInstaller.php +++ b/core/lib/Drupal/Core/Config/ConfigInstaller.php @@ -8,6 +8,7 @@ namespace Drupal\Core\Config; use Drupal\Component\Utility\Unicode; +use Drupal\Core\Cache\CacheTagsInvalidatorInterface; use Drupal\Core\Config\Entity\ConfigDependencyManager; use Drupal\Core\Site\Settings; use Symfony\Component\EventDispatcher\EventDispatcherInterface; @@ -50,6 +51,13 @@ class ConfigInstaller implements ConfigInstallerInterface { protected $eventDispatcher; /** + * The cache tags invalidator. + * + * @var \Drupal\Core\Cache\CacheTagsInvalidatorInterface + */ + protected $cacheTagsInvalidator; + + /** * The configuration storage that provides the default configuration. * * @var \Drupal\Core\Config\StorageInterface @@ -76,13 +84,16 @@ class ConfigInstaller implements ConfigInstallerInterface { * The configuration manager. * @param \Symfony\Component\EventDispatcher\EventDispatcherInterface $event_dispatcher * The event dispatcher. + * @param \Drupal\Core\Cache\CacheTagsInvalidatorInterface $cache_tags_invalidator + * The cache tags invalidator. */ - public function __construct(ConfigFactoryInterface $config_factory, StorageInterface $active_storage, TypedConfigManagerInterface $typed_config, ConfigManagerInterface $config_manager, EventDispatcherInterface $event_dispatcher) { + public function __construct(ConfigFactoryInterface $config_factory, StorageInterface $active_storage, TypedConfigManagerInterface $typed_config, ConfigManagerInterface $config_manager, EventDispatcherInterface $event_dispatcher, CacheTagsInvalidatorInterface $cache_tags_invalidator) { $this->configFactory = $config_factory; $this->activeStorage = $active_storage; $this->typedConfig = $typed_config; $this->configManager = $config_manager; $this->eventDispatcher = $event_dispatcher; + $this->cacheTagsInvalidator = $cache_tags_invalidator; } /** @@ -200,7 +211,7 @@ protected function createConfiguration($collection, array $config_to_install) { $new_config = $overrider->createConfigObject($name, $collection); } else { - $new_config = new Config($name, $this->getActiveStorage($collection), $this->eventDispatcher, $this->typedConfig); + $new_config = new Config($name, $this->getActiveStorage($collection), $this->eventDispatcher, $this->typedConfig, $this->cacheTagsInvalidator); } if ($data[$name] !== FALSE) { $new_config->setData($data[$name]);