Issue #3586509: Drop autoconfigure from domain_config services

Summary

Fix for #3586509. On sites where the language module is not actually enabled (e.g. orphaned dependency in core.extension.yml, partial config sync), drush updatedb fatals during container compilation:

Error: Interface "Drupal\\language\\Config\\LanguageConfigFactoryOverrideInterface" not found
in domain_config/src/Config/DomainLanguageConfigFactoryOverrideInterface.php on line 10

Root cause

domain_config/domain_config.services.yml enabled _defaults: autoconfigure: true (added in #3060758, commit 93f30d19). Symfony's RegisterAutoconfigureAttributesPass then reflects on every service class at compile time looking for #[Autoconfigure*] / #[As*] attributes. Reflecting on DomainLanguageConfigFactoryOverride autoloads its interface, which extends Drupal\language\Config\LanguageConfigFactoryOverrideInterface — fatal when the language module's namespace is not registered.

Fix

Drop autoconfigure: true from _defaults. None of the services in domain_config/src/ declare any Symfony autoconfiguration attribute, so the directive is pure overhead. Removing it eliminates the eager-reflection cascade. autowire: true is preserved (it triggers reflection only at instantiation time, after the kernel has registered module namespaces).

What this does and does not fix

  • Fixes: bootstrap-order edge cases where the language module is enabled but its namespace is not yet registered when the autoconfigure pass runs. Container compiles cleanly.
  • Does not fix: sites where the language module is genuinely missing from core.extension.yml. Those will still fatal later, when config.factory collects its overrides. A complementary #[Hook('install_requirements')] / #[Hook('update_requirements')] check in domain_config.install would surface a clear error before the autoload cascade — out of scope for this MR.

Test plan

  • Container compiles cleanly on a 3.x site with language enabled (existing behaviour).
  • No service in domain_config/src/ relied on autoconfiguration (verified: zero #[Autoconfigure*] / #[As*] attributes in the submodule).
  • Existing tests should be unaffected since all tags, decorators, aliases and service-id mappings are already declared explicitly in domain_config.services.yml.
  • Original commit that introduced autoconfigure: true: 93f30d19 (#3060758).
  • Companion commit that added autowire: true: ed7dbfd5 (#3554240) — kept as-is.

Merge request reports

Loading