Allow setting domain config override

Created on 7 September 2023, over 1 year ago
Updated 18 October 2023, about 1 year ago

Drupal Version

8.x +

Domain module version

8.x +

Expected Behavior

I have a drush command that brings in content and assigns it to a domain. I also have Mailchimp with config per domain. I need my drush command to be able to set the domain that is used for the config override. I expect there to be a way to set the active domain so that when Mailchimp loads its config, it loads the config for the domain I have set.

Actual Behavior

There doesn't appear to be a way to set the domain to be used for config override.

Steps to reproduce

Feature request
Status

Active

Version

1.0

Component

- Domain Config

Created by

🇬🇧United Kingdom oliverpolden

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

  • Issue created by @oliverpolden
  • Open in Jenkins → Open on Drupal.org →
    Core: 9.5.x + Environment: PHP 8.1 & MySQL 5.7
    last update over 1 year ago
    93 pass
  • @oliverpolden opened merge request.
  • 🇬🇧United Kingdom oliverpolden

    With this you can inject the domainConfigOverrider (domain_config.overrider) service and then do:

    // Load the domain you want.
    $domain = $this->myFunctionToLoadADomain($params);
    $this->domainConfigOverrider->setDomain($domain);

    I have tested this by creating an entity from my primary domain with settings on the entity that relate to two different domains. I have an event subscriber on entity insert that determines the domain and triggers a MailChimp campaign. The MailChimp module successfully loads the config for the relevant domain.

Production build 0.71.5 2024