diff --git a/core/core.services.yml b/core/core.services.yml index b274c73..6134359 100644 --- a/core/core.services.yml +++ b/core/core.services.yml @@ -83,7 +83,7 @@ services: arguments: ['@config.storage', '@event_dispatcher', '@config.typed'] config.installer: class: Drupal\Core\Config\ConfigInstaller - arguments: ['@config.factory', '@config.storage', '@config.typed', '@entity.manager', '@event_dispatcher', '@uuid'] + arguments: ['@config.factory', '@config.storage', '@config.typed', '@entity.manager', '@event_dispatcher'] config.storage.staging: class: Drupal\Core\Config\FileStorage factory_class: Drupal\Core\Config\FileStorageFactory diff --git a/core/lib/Drupal/Core/Config/ConfigInstaller.php b/core/lib/Drupal/Core/Config/ConfigInstaller.php index f634afa..dc4f3b9 100644 --- a/core/lib/Drupal/Core/Config/ConfigInstaller.php +++ b/core/lib/Drupal/Core/Config/ConfigInstaller.php @@ -8,8 +8,6 @@ namespace Drupal\Core\Config; use Drupal\Component\Utility\Unicode; -use Drupal\Component\Uuid\UuidInterface; -use Drupal\Core\Config\Context\FreeConfigContext; use Drupal\Core\Entity\EntityManagerInterface; use Symfony\Component\EventDispatcher\EventDispatcherInterface; @@ -51,13 +49,6 @@ class ConfigInstaller implements ConfigInstallerInterface { protected $eventDispatcher; /** - * The UUID generation service. - * - * @var \Drupal\Component\Uuid\UuidInterface - */ - protected $uuidService; - - /** * Constructs the configuration installer. * * @param \Drupal\Core\Config\ConfigFactory $config_factory @@ -70,16 +61,13 @@ class ConfigInstaller implements ConfigInstallerInterface { * The entity manager. * @param \Symfony\Component\EventDispatcher\EventDispatcherInterface $event_dispatcher * The event dispatcher. - * @param \Drupal\Component\Uuid\UuidInterface $uuid_service - * The UUID generation service. */ - public function __construct(ConfigFactory $config_factory, StorageInterface $active_storage, TypedConfigManagerInterface $typed_config, EntityManagerInterface $entity_manager, EventDispatcherInterface $event_dispatcher, UuidInterface $uuid_service) { + public function __construct(ConfigFactory $config_factory, StorageInterface $active_storage, TypedConfigManagerInterface $typed_config, EntityManagerInterface $entity_manager, EventDispatcherInterface $event_dispatcher) { $this->configFactory = $config_factory; $this->activeStorage = $active_storage; $this->typedConfig = $typed_config; $this->entityManager = $entity_manager; $this->eventDispatcher = $event_dispatcher; - $this->uuidService = $uuid_service; } /** @@ -113,15 +101,14 @@ public function installDefaultConfig($type, $name) { } if (!empty($config_to_install)) { - $context = new FreeConfigContext($this->eventDispatcher, $this->uuidService); - $this->configFactory->enterContext($context); + $this->configFactory->disableOverrides(); foreach ($config_to_install as $name) { // Only import new config. if ($this->activeStorage->exists($name)) { continue; } - $new_config = new Config($name, $this->activeStorage, $context, $this->typedConfig); + $new_config = new Config($name, $this->activeStorage, $this->eventDispatcher, $this->typedConfig); $data = $source_storage->read($name); if ($data !== FALSE) { $new_config->setData($data); @@ -135,11 +122,8 @@ public function installDefaultConfig($type, $name) { else { $new_config->save(); } - - // Reset static cache on the config factory. - $this->configFactory->reset($name); } - $this->configFactory->leaveContext(); + $this->configFactory->enableOverrides(); } }