Commit 25f990b1 authored by catch's avatar catch

Issue #2816307 by GoZ, himanshu-dixit, james.williams, Jo Fitzgerald,...

Issue #2816307 by GoZ, himanshu-dixit, james.williams, Jo Fitzgerald, dawehner, claudiu.cristea, catch: array_unique notice from List unmet configuration dependencies instead of just failing
parent 2cd2ec6c
......@@ -466,7 +466,7 @@ public function checkConfigurationToInstall($type, $name) {
// Check the dependencies of configuration provided by the module.
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));
throw UnmetDependenciesException::create($name, array_unique($missing_dependencies, SORT_REGULAR));
}
// Install profiles can not have config clashes. Configuration that
......
id: other_module_test_with_dependency
label: 'Other module test with dependency'
weight: 0
style: ''
status: true
langcode: en
protected_property: Default
dependencies:
enforced:
module:
- config_other_module_config_test
config:
- config_test.dynamic.dotted.english
id: yet_another_module_test_with_dependency
label: 'Yet anther module test with dependency'
weight: 0
style: ''
status: true
langcode: en
protected_property: Default
dependencies:
enforced:
module:
- config_other_module_config_test
config:
- config_test.dynamic.dotted.english
name: 'Config install double dependency test'
type: module
package: Testing
version: VERSION
core: 8.x
......@@ -202,6 +202,15 @@ public function testDependencyChecking() {
$this->assertEqual($e->getConfigObjects(), ['config_test.dynamic.other_module_test_with_dependency' => ['config_other_module_config_test', 'config_test.dynamic.dotted.english']]);
$this->assertEqual($e->getMessage(), 'Configuration objects provided by <em class="placeholder">config_install_dependency_test</em> have unmet dependencies: <em class="placeholder">config_test.dynamic.other_module_test_with_dependency (config_other_module_config_test, config_test.dynamic.dotted.english)</em>');
}
try {
$this->installModules(['config_install_double_dependency_test']);
$this->fail('Expected UnmetDependenciesException not thrown.');
}
catch (UnmetDependenciesException $e) {
$this->assertEquals('config_install_double_dependency_test', $e->getExtension());
$this->assertEquals(['config_test.dynamic.other_module_test_with_dependency' => ['config_other_module_config_test', 'config_test.dynamic.dotted.english']], $e->getConfigObjects());
$this->assertEquals('Configuration objects provided by <em class="placeholder">config_install_double_dependency_test</em> have unmet dependencies: <em class="placeholder">config_test.dynamic.other_module_test_with_dependency (config_other_module_config_test, config_test.dynamic.dotted.english)</em>', $e->getMessage());
}
$this->installModules(['config_test_language']);
try {
$this->installModules(['config_install_dependency_test']);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment