diff --git a/core/lib/Drupal/Core/Config/ConfigInstaller.php b/core/lib/Drupal/Core/Config/ConfigInstaller.php index 205f270..58b189d 100644 --- a/core/lib/Drupal/Core/Config/ConfigInstaller.php +++ b/core/lib/Drupal/Core/Config/ConfigInstaller.php @@ -161,7 +161,7 @@ protected function listDefaultConfigCollection($collection, $type, $name, array if (in_array($config_name, $config_to_install)) { return FALSE; } - // Ensure the configuration is provided by an enabled module + // Ensure the configuration is provided by an enabled module. $provider = Unicode::substr($config_name, 0, strpos($config_name, '.')); return in_array($provider, $enabled_extensions); }); @@ -341,7 +341,7 @@ public function findPreExistingConfiguration($type, $name) { $collection_info = $this->configManager->getConfigCollectionInfo(); // Read enabled extensions directly from configuration to avoid circular - // dependencies with ModuleHandler and ThemeHandler. + // dependencies on ModuleHandler and ThemeHandler. $extension_config = $this->configFactory->get('core.extension'); $enabled_extensions = array_keys((array) $extension_config->get('module')); $enabled_extensions += array_keys((array) $extension_config->get('theme')); diff --git a/core/lib/Drupal/Core/Config/PreExistingConfigException.php b/core/lib/Drupal/Core/Config/PreExistingConfigException.php index eabb7f0..d34a7ad 100644 --- a/core/lib/Drupal/Core/Config/PreExistingConfigException.php +++ b/core/lib/Drupal/Core/Config/PreExistingConfigException.php @@ -8,7 +8,7 @@ namespace Drupal\Core\Config; /** - * An exception thrown if configuration already exists with the same name. + * An exception thrown if configuration with the same name already exists. */ class PreExistingConfigException extends ConfigException { } diff --git a/core/lib/Drupal/Core/Extension/ModuleInstaller.php b/core/lib/Drupal/Core/Extension/ModuleInstaller.php index a8610b1..eaacec9 100644 --- a/core/lib/Drupal/Core/Extension/ModuleInstaller.php +++ b/core/lib/Drupal/Core/Extension/ModuleInstaller.php @@ -131,7 +131,8 @@ public function install(array $module_list, $enable_dependencies = TRUE) { ))); } - // Profiles can not have config clashes. + // Install profiles can not have config clashes as if they contain + // configuration with the same name as a module it will override it. if ($module != drupal_get_profile()) { // Validate default configuration of this module. Bail if unable to // install. Should not continue installing more modules because those diff --git a/core/modules/forum/config/install/taxonomy.vocabulary.forums.yml b/core/modules/forum/config/install/taxonomy.vocabulary.forums.yml index 6ed487b..951e4a3 100644 --- a/core/modules/forum/config/install/taxonomy.vocabulary.forums.yml +++ b/core/modules/forum/config/install/taxonomy.vocabulary.forums.yml @@ -1,6 +1,9 @@ langcode: en status: true -dependencies: { } +dependencies: + enforced: + module: + - forum name: Forums vid: forums description: 'Forum navigation vocabulary' diff --git a/core/modules/system/src/Controller/ConfigClashController.php b/core/modules/system/src/Controller/ConfigClashController.php index 43c58e9..158b800 100644 --- a/core/modules/system/src/Controller/ConfigClashController.php +++ b/core/modules/system/src/Controller/ConfigClashController.php @@ -61,6 +61,8 @@ class ConfigClashController extends ControllerBase { * The key value expirable factory. * @param \Drupal\Core\Config\ConfigManagerInterface $config_manager * The configuration manager. + * @param \Drupal\Core\Config\ConfigInstallerInterface $config_installer + * The configuration installer. */ public function __construct(KeyValueStoreExpirableInterface $key_value_expirable, ConfigManagerInterface $config_manager, ConfigInstallerInterface $config_installer) { $this->keyValueExpirable = $key_value_expirable; @@ -122,7 +124,7 @@ public function moduleReport() { * The report as a render array. */ protected function report($type, array $extensions) { - // Check if we have any pre existing configuration. + // Check if we have any pre-existing configuration. $existing_configuration = array(); foreach ($extensions as $extension) { $existing_configuration = array_merge_recursive($this->configInstaller->findPreExistingConfiguration($type, $extension), $existing_configuration); @@ -152,10 +154,14 @@ protected function report($type, array $extensions) { } } else { - // Super weird. + // @todo: Work out + $report['config_clashes']['#items'][] = $config_name; } } } + $report['debug'] = array( + '#markup' => '

' . print_r($existing_configuration, TRUE) . '

', + ); } return $report; diff --git a/core/modules/system/src/Form/ModulesListForm.php b/core/modules/system/src/Form/ModulesListForm.php index 5608a3a..2be620b 100644 --- a/core/modules/system/src/Form/ModulesListForm.php +++ b/core/modules/system/src/Form/ModulesListForm.php @@ -508,7 +508,7 @@ public function submitForm(array &$form, FormStateInterface $form_state) { // Retrieve a list of modules to install and their dependencies. $modules = $this->buildModuleList($form_state); - // Check if we have any pre existing configuration. + // Check if we have any pre-existing configuration. $existing_configuration = array(); foreach (array_keys($modules['install']) as $module) { $existing_configuration = array_merge_recursive($this->configInstaller->findPreExistingConfiguration('module', $module), $existing_configuration); diff --git a/core/modules/system/system.routing.yml b/core/modules/system/system.routing.yml index d5d134a..23c9aa5 100644 --- a/core/modules/system/system.routing.yml +++ b/core/modules/system/system.routing.yml @@ -288,7 +288,7 @@ system.theme_install: system.modules_config_clash: path: 'admin/modules/config_clash' defaults: - _content: 'Drupal\system\Controller\ConfigClashController::moduleReport' + _controller: 'Drupal\system\Controller\ConfigClashController::moduleReport' _title: 'Configuration clash' requirements: _permission: 'administer modules'