Drupal Version
Drupal 8
Domain module version
8.x-1.x
Expected Behavior
When overriding nested config properties within both settings.php and domain.config yml files, i'd expect for these values to be merged.
Actual Behavior
The settings.php config completely overrides the domain.config config essentially ignoring the DB domain config.
Steps to reproduce
Override domain config within your DB/YML files (domain.config.DOMAIN.CONFIG_NAME.yml)
setting_one: hello
setting_two: world
In your settings.php file override one of the properties:
$config["domain.config.DOMAIN.CONFIG_NAME"]['setting_two'] = 'new value';
The resulting domain config overrides will be only:
setting_two: new_value
Attaching a patch to resolve this issue, but not sure if this is causing a breaking change for anyone which relies on the complete override of all config within settings.php even though this doesn't seem like the expected behavior.
| Comment | File | Size | Author |
|---|---|---|---|
| #4 | domain-config-settings-override-merge-3214209-2.patch | 984 bytes | skrasulevskiy |
| #2 | domain-config-settings-override-merge-3214209-1.patch | 1.24 KB | ocastle |
Issue fork domain-3214209
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #2
ocastle commentedComment #3
agentrickardCould use a test.
Comment #4
skrasulevskiy commentedHello,
I attached the updated patch, because this one is not applied https://www.drupal.org/project/domain/issues/3214209#comment-14104529
Comment #5
agentrickardStill needs a test.
If you look at DomainConfigOverriderTest, you will see two methods testDomainConfigOverrider() and testDomainConfigOverriderFromSettings()
We need a new test that combines these, loading config from testDomainConfigOverrider() and also introducing soemthing from settings. But to actually test what you want, we also need to add another variable under test.
Adding system.site.slogan seems like an easy addition. Set that in settings and name in config and then ensure the values are merged.
Comment #6
mably commentedSounds like an interesting feature to have.
Will create an MR with a test for it.
Comment #8
mably commentedComment #10
mably commentedComment #12
sokru commentedA little late to party, but this change broke our samlauth login. On our settings.php we had
$config['domain.config.OUR_SITE.samlauth.authentication']['sp_private_key'] = 'file://...'and this caused a PHP warning "Warning: Undefined array key "samlauth.authentication" in Drupal\domain_config\DomainConfigOverrider->loadOverrides() (line 195 of modules/contrib/domain/domain_config/src/DomainConfigOverrider.php" since the "NestedArray::mergeDeepArray" assumes the configuration already exists on filesystem.Comment #13
mably commented@sokru should be easily fixable. Could you create an issue for it please?
Comment #15
mably commented@sokru I finally created an extra MR in this current issue.
Could you have a look at it and tell me if it fixes your problem?
Comment #16
mably commentedComment #17
sokru commentedThanks @mably, that works fine.
Comment #18
mably commentedOk, thanks, let's merge it!
Comment #20
mably commented