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.

Issue fork domain-3214209

Command icon 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

ocastle created an issue. See original summary.

ocastle’s picture

Status: Active » Needs review
StatusFileSize
new1.24 KB
agentrickard’s picture

Component: - Domain Conf » Code
Status: Needs review » Needs work

Could use a test.

skrasulevskiy’s picture

Hello,
I attached the updated patch, because this one is not applied https://www.drupal.org/project/domain/issues/3214209#comment-14104529

agentrickard’s picture

Still 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.

mably’s picture

Version: 8.x-1.x-dev » 2.0.x-dev

Sounds like an interesting feature to have.

Will create an MR with a test for it.

mably’s picture

Category: Bug report » Feature request
Status: Needs work » Needs review

  • mably committed 4a6f385c on 2.0.x
    Issue #3214209 by ocastle, skrasulevskiy, mably: Unable to override...
mably’s picture

Status: Needs review » Fixed

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.

sokru’s picture

A 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.

mably’s picture

@sokru should be easily fixable. Could you create an issue for it please?

mably’s picture

@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?

mably’s picture

Status: Closed (fixed) » Needs review
sokru’s picture

Status: Needs review » Reviewed & tested by the community

Thanks @mably, that works fine.

mably’s picture

Ok, thanks, let's merge it!

  • mably committed b628244c on 2.0.x
    Issue #3214209 by ocastle, agentrickard, skrasulevskiy, mably, sokru:...
mably’s picture

Status: Reviewed & tested by the community » Fixed

Now that this issue is closed, please review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, please credit people who helped resolve this issue.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.