Our configuration entity dependency system only understands names, not capabilities. That is, we only check if names match to decide if something meets a dependency, not the capabilities of a config entity.
If a module ships foo.bar.config_entity, and that already exists in the active store, we have no way to know if it is safe to install the module. This is not to say things will break - we just have no idea, because we only use names. Fixing that is another discussion.
As such, we can't install a module unless all of it's default config entities are installed, because we can't see if an existing config entity with the same name provides the capabilities that the module requires.
We could also do on-the-fly renames during module install, but that would require a new code path for what is potentially a corner case.
This issue was created as a result of @yched's comment
We should block install of any module where the config entity names match an existing config entity, and provide an error screen explaining why we blocked install and how the user can resolve the issue.
"Foo module could not be installed because some of it's default configuration can not be installed. Please rename "$foo.bar" so that installation is possible."
|Task||Novice task?||Contributor instructions||Complete?|
|(after reroll) Create a patch to address points in #86 (and update verbiage?) and make an interdiff||Instructions|
|Reroll the patch if it no longer applies.||Instructions|
|(after reroll) Add automated tests||Instructions|
|Embed before and after screenshots in the issue summary||Novice||Instructions|
|discuss UX (see #84)|
|when this is fixed, unpostpone|
User interface changes
A new warning message.
A new way in module installation can fail.
How to test and current screenshots
- Open settings.php and at the end uncomment the lines to include settings.local.php
- Open settings.local.php and make sure extension_discovery_scan_tests is uncommented - this allows you to enable test modules
- Go to admin/modules, you can test following scenarios.
- Toggle 'Configuration test' and 'Configuration install fail test' - you should get a message after enabling on the modules page
- Toggle 'Configuration install fail test'. You should go to the confirm form and after that a message on the modules page
- Toggle 'Configuration install fail dependency test'. You should go to the confirm form and after that a message on the modules page
- Enable 'Configuration test' separately. After that enable 'Configuration install fail test'. You should go to admin/extend/config-clash and see information on the clashing configuration
PASSED: [[SimpleTest]]: [PHP 5.4 MySQL] 83,999 pass(es). View
PASSED: [[SimpleTest]]: [PHP 5.4 MySQL] 83,989 pass(es). View
PASSED: [[SimpleTest]]: [PHP 5.4 MySQL] 83,993 pass(es). View