diff --git a/core/lib/Drupal/Core/Config/ConfigInstaller.php b/core/lib/Drupal/Core/Config/ConfigInstaller.php index b798dcf..8be5b6d 100644 --- a/core/lib/Drupal/Core/Config/ConfigInstaller.php +++ b/core/lib/Drupal/Core/Config/ConfigInstaller.php @@ -90,11 +90,11 @@ public function __construct(ConfigFactoryInterface $config_factory, StorageInter $this->typedConfig = $typed_config; $this->configManager = $config_manager; $this->eventDispatcher = $event_dispatcher; - if (isset($profile_handler)) { - $this->profileHandler = $profile_handler; + if (!isset($profile_handler) && \Drupal::hasService('profile_handler')) { + $this->profileHandler = \Drupal::service('profile_handler'); } else { - $this->profileHandler = \Drupal::service('profile_handler'); + $this->profileHandler = $profile_handler; } } diff --git a/core/lib/Drupal/Core/Config/InstallStorage.php b/core/lib/Drupal/Core/Config/InstallStorage.php index e459d9f..dd5f208 100644 --- a/core/lib/Drupal/Core/Config/InstallStorage.php +++ b/core/lib/Drupal/Core/Config/InstallStorage.php @@ -69,7 +69,12 @@ class InstallStorage extends FileStorage { */ public function __construct($directory = self::CONFIG_INSTALL_DIRECTORY, $collection = StorageInterface::DEFAULT_COLLECTION, ProfileHandlerInterface $profile_handler = NULL) { parent::__construct($directory, $collection); - $this->profileHandler = $profile_handler ?: \Drupal::service('profile_handler'); + if (!isset($profile_handler) && \Drupal::hasService('profile_handler')) { + $this->profileHandler = \Drupal::service('profile_handler'); + } + else { + $this->profileHandler = $profile_handler; + } } /**