Enabling change for the Domain Extras follow-up #3592950, and builds on #3592832.

Problem/Motivation

The DomainConfigEditContext seam (added in #3592832) lets a consumer set a name-scoped editing domain so config forms read and write that domain's overrides instead of the negotiated domain's. But it always resolves to a domain: DomainConfigEditContext::getDomainId() returns the editing domain when set, otherwise the negotiated domain. It cannot represent "edit the base/default configuration, ignoring the domain".

Domain 2.0.x's switcher (the SwitchForm in domain_config_ui) offered an "All Domains" option, gated by the set default domain configuration permission, that edited the site-wide default (base) configuration from any page. The 3.x editing context cannot express that, so consumers (such as the domain_config_switcher submodule in Domain Extras, #3592820) cannot offer it. Today the base config is only reachable by removing a domain's override via the enable/disable toggler.

Proposed resolution

Extend DomainConfigEditContext (and DomainConfigUIManagerInterface as needed) with an explicit "default/base configuration" editing mode in which DomainConfigFactory applies no domain override for the scoped configuration names - the form reads and writes the base config - independent of the negotiated domain.

  • Add an explicit state distinct from "no editing domain set" (e.g. a setEditingDefault(array $config_names) method, or a dedicated sentinel from setEditingDomain()).
  • Preserve backward compatibility: with nothing set, getDomainId() must still return the negotiated domain - no behavior change for current callers.
  • Keep it name-scoped, like the existing editing-domain mode.

Remaining tasks

  • Design the API addition (method + how DomainConfigFactory interprets the base mode).
  • Implement + kernel tests: base mode targets the base config; BC fallback to negotiation unchanged; name-scoping respected.
  • Update the DomainConfigEditContext developer-API docs.

User interface changes

None - this is a developer-facing seam addition. The UI lives in consumers (the domain_config_switcher "All domains" option, #3592950).

Issue fork domain-3592951

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

mably created an issue. See original summary.

mably’s picture

Status: Active » Needs review

  • mably committed 03054aa3 on 3.x
    feat: #3592951 domain_config_ui: let DomainConfigEditContext target the...
mably’s picture

Status: Needs review » Fixed

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

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

Maintainers, credit people who helped resolve this issue.

Status: Fixed » Closed (fixed)

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