feat: #3588828 Split domain_config and domain_config_ui to make the language module optional
Summary
Closes #3588828.
Splits domain_config and domain_config_ui so the language module
becomes optional for monolingual sites that only need per-domain
overrides.
What this MR does
Structural split
domain_configstops requiringdrupal:language. Only the domain-only override services and helpers stay.- New
domain_config_languageships the language-aware override services (DomainLanguageConfigFactoryOverride,DomainConfigLanguageManager,DomainLanguageConfigOverride,DomainLanguageConfigCollectionNameTrait). Hard-deps ondrupal:languageanddomain:domain_config. domain_config_uistops referencing the language override service. The inline language-override delete loop inDomainConfigFactory::deleteConfigurationOverridesForDomain()becomes an event subscriber onDomainConfigOverrideEvents::DELETE_OVERRIDE. The "Languages" column on the overview page becomes a new alter hook,hook_domain_config_ui_overview_alter(), documented in the module's.api.php.- New
domain_config_language_uicarries thelanguage_managerdecorator (DomainConfigUILanguageManager), the cleanup subscriber, and the alter-hook implementation that restores the Languages column.
Service IDs are stable
domain.language.config_factory_override and
domain.language_manager keep the same string IDs — only the module
that registers them changes. Consumer code calling
\Drupal::service('domain.language.config_factory_override') keeps
working unchanged.
Storage layout is unchanged
The config-collection naming (domain.{id} and
domain.{id}.language.{lang}) is preserved. No data migration
needed.
Update hooks
domain_config_update_10002()auto-installsdomain_config_languagewhen thelanguagemodule is enabled.domain_config_ui_update_10002()auto-installsdomain_config_language_uiwhen thelanguagemodule is enabled.
Existing 3.x sites upgrade transparently — they always had language
enabled (it was a hard dep), so they get both new submodules
automatically.
Tests reorganized to match
DomainConfigTestBaseis now language-agnostic.- New
DomainConfigLanguageTestBaseindomain_config_languageadds the language module and a Spanish language during setUp. - Language-bound tests moved to the language modules:
DomainConfigOverriderTestwas split (the langcode-iterating method becameDomainLanguageConfigOverriderTest);DomainConfigHomepageTestand 8 UI tests moved whole;DomainConfigUIOptionsTestwas split (thetestDisallowedRoutesHookhalf stayed indomain_config_uias a new dedicated class). - Tests that previously installed
'language'without using it had the dep dropped. - New coverage for the new code paths:
DomainLanguageOverrideCleanupSubscriberTest(kernel) — locks in the per-language cleanup contract.DomainConfigUIOverviewLanguageColumnTest(functional) — locks in the alter-hook column rendering.DomainConfigOverrideEditableTesthad its$modulesarray documented as the standalone-scenario lock-in (nolanguage, nodomain_config_language).
PHP namespaces
The moved classes are all marked @internal (#3584261) so the
public API contract is the service IDs. Custom code typehinting
the moved classes needs use updates from
Drupal\domain_config\… to Drupal\domain_config_language\….
Docs
New docs/domain_config_language/ and
docs/domain_config_language_ui/ pages (en/fr/es), mkdocs.yml
nav updated for all three locales, CHANGELOG entry for 3.1.0.
Test plan
- CI matrix runs the new submodules' tests automatically (DrupalCI
discovers tests under
tests/). DomainConfigOverrideEditableTestprovesdomain_configworks standalone (no language).DomainLanguageOverrideCleanupSubscriberTestproves the cleanup subscriber removes per-language rows when their base override is deleted.DomainConfigUIOverviewLanguageColumnTestproves the alter hook injects the Languages column with correct values.- All existing language-aware tests (overrides, translation, saved
config, settings, cast value, multi-form, registered) keep
passing under their new home in
domain_config_language_ui.