Issue #3592950: Add a "Base configuration" option to the domain configuration switcher
Summary
Adds a Base configuration option to the Domain Configuration Switcher, restoring Domain 2.0.x's "All Domains" workflow: editing the default configuration every domain inherits unless it has its own per-domain override.
This is the consumer of the DomainConfigEditContext::BASE seam added in
domain #3592951.
What it does
DomainConfigSwitcherInterface::canSelectBaseConfig()- gated by bothuse domain config switcherandset default domain configuration, so base editing is a strict sub-capability of the switcher.- The selection round-trips the
BASEsentinel through the service: it is stored and read back only while the user may use it, and the permission is re-checked on every request, so base editing is never applied for a user who has lost the permission. - The form select gains a Base configuration option (only for permitted
users), applied with
setEditingDomain(BASE, $config_names). The help text reflects that a base save affects every domain without its own override. - The switcher also appears when base editing is the only thing available (the user has no selectable per-domain targets).
Because getDomainId() resolves to NULL in base mode, domain_config_ui's own
hook_form_alter() does not run (no toggler, no permission validator); the
switcher therefore owns the UI and the gating, which is exactly what this
permission-aware selection provides.
Tests
- Kernel (
DomainConfigSwitcherTest): base selection is rejected without the permission; with it, theBASEsentinel round-trips andgetSelectedDomain()resolves toNULL(the base is not a domain). - Functional (
DomainConfigSwitcherUiTest): the option is shown only with the permission; selecting it writes the base configuration and leaves every per-domain override (including the registered negotiated domain's) untouched.
Verified locally: kernel green; functional green in Docker (4 tests / 47 assertions). PHPCS (Drupal,DrupalPractice) / PHPStan / CSpell clean.
Blocked by
- domain #3592951 (MR !388) - provides
DomainConfigEditContextInterface:: BASE. The composer constraint (drupal/domain) must be bumped to the release that ships it before this MR is merged; until then CI cannot resolve the constant.