diff --git a/core/lib/Drupal/Core/Config/ConfigInstaller.php b/core/lib/Drupal/Core/Config/ConfigInstaller.php index 14f44e9..aa7823f 100644 --- a/core/lib/Drupal/Core/Config/ConfigInstaller.php +++ b/core/lib/Drupal/Core/Config/ConfigInstaller.php @@ -455,8 +455,7 @@ public function checkConfigurationToInstall($type, $name) { $profile_storages = $this->getProfileStorages($name); // Check the dependencies of configuration provided by the module. - $missing_dependencies = []; - $invalid_default_config = $this->findDefaultConfigWithUnmetDependencies($storage, $enabled_extensions, $profile_storages, $missing_dependencies); + list($invalid_default_config, $missing_dependencies) = $this->findDefaultConfigWithUnmetDependencies($storage, $enabled_extensions, $profile_storages); if (!empty($invalid_default_config)) { throw UnmetDependenciesException::create($name, array_unique($missing_dependencies)); } @@ -484,14 +483,15 @@ public function checkConfigurationToInstall($type, $name) { * @param \Drupal\Core\Config\StorageInterface[] $profile_storages * An array of storage interfaces containing profile configuration to check * for overrides. - * @param array $missing_dependencies - * (optional) An array that will be filled with the list of missing - * dependencies, keyed by by the dependents' names. * * @return array - * List of configuration that has unmet dependencies. + * An array containing: + * - A list of configuration that has unmet dependencies. + * - An array that will be filled with the list of missing + * dependencies, keyed by by the dependents' names. */ protected function findDefaultConfigWithUnmetDependencies(StorageInterface $storage, array $enabled_extensions, array $profile_storages = [], array &$missing_dependencies = []) { + $missing_dependencies = []; $config_to_create = $this->getConfigToCreate($storage, StorageInterface::DEFAULT_COLLECTION, '', $profile_storages); $all_config = array_merge($this->configFactory->listAll(), array_keys($config_to_create)); foreach ($config_to_create as $config_name => $config) { @@ -499,7 +499,10 @@ protected function findDefaultConfigWithUnmetDependencies(StorageInterface $stor $missing_dependencies[$config_name] = $missing; } } - return array_intersect_key($config_to_create, $missing_dependencies); + return [ + array_intersect_key($config_to_create, $missing_dependencies), + $missing_dependencies, + ]; } /** diff --git a/core/lib/Drupal/Core/Config/UnmetDependenciesException.php b/core/lib/Drupal/Core/Config/UnmetDependenciesException.php index e49afc9..30641ec 100644 --- a/core/lib/Drupal/Core/Config/UnmetDependenciesException.php +++ b/core/lib/Drupal/Core/Config/UnmetDependenciesException.php @@ -69,10 +69,10 @@ public function getExtension() { */ public function getTranslatedMessage(TranslationInterface $string_translation, $extension) { return $string_translation->translate( - 'Unable to install @extension due to unmet dependencies: @config_names', + 'Unable to install %extension due to unmet dependencies: %config_names', [ - '@config_names' => self::formatConfigObjectList($this->configObjects), - '@extension' => $extension, + '%config_names' => static::formatConfigObjectList($this->configObjects), + '%extension' => $extension, ] ); } @@ -89,10 +89,10 @@ public function getTranslatedMessage(TranslationInterface $string_translation, $ * @return \Drupal\Core\Config\PreExistingConfigException */ public static function create($extension, array $config_objects) { - $message = SafeMarkup::format('Configuration objects provided by @extension have unmet dependencies: @config_names', + $message = SafeMarkup::format('Configuration objects provided by %extension have unmet dependencies: %config_names', array( - '@config_names' => static::formatConfigObjectList($config_objects), - '@extension' => $extension + '%config_names' => static::formatConfigObjectList($config_objects), + '%extension' => $extension ) ); $e = new static($message);