Follow-up to #3612485: Remove all code deprecated for removal in 4.0.0, which added the ^12 core requirement, enabled the next-major CI lane, brought the Drupal 12 PHPStan lane to green, and fixed most of the Drupal 12 PHPUnit failures. This issue covers the last piece: the per-domain library override.
Port the per-domain library override to the current library discovery service.
domain_config decorates the library discovery so that library definitions, which hook_library_info_build() and hook_library_info_alter() implementations may build from configuration that is overridden per domain, are cached per domain. It decorated library.discovery.collector, which core deprecated in Drupal 11.1 and removed in Drupal 12, and decoration_on_invalid: ignore kept the module installable on Drupal 12 with the override inactive there. Since Drupal 11.1 the library.discovery service is the LibraryDiscoveryCollector itself, the same class with the same constructor on Drupal 11.4 and on Drupal 12, so the decoration now targets library.discovery and the stopgap is gone. One service definition covers both lanes of ^11.4 || ^12.
The decoration was therefore inactive on every core release the 4.x branch supports, not only on Drupal 12. The merge request adds the kernel coverage that was missing: the first domain builds its library definitions and the collector writes them to the discovery cache, and the second domain must then build its own definitions rather than read the entry the first domain wrote.
Nothing to migrate for a site: no configuration, no schema, no update hook, only cache.discovery entries that rebuild themselves. A site that referred to the service id domain_config.library.discovery.collector needs the new id, domain_config.library.discovery.
Also resolved since this issue was filed
The Drupal 12 PHPUnit failures listed in the original summary are gone. #3616749: Drupal 12 compatibility: the RouteProvider constructor arguments and the shape of submitted domain field values fixed DomainSourceRouterProviderTest against the new RouteProvider constructor signature, and #3616783: Fix the remaining Drupal 12 test failures and stop deprecations failing the next-major lane fixed the five remaining functional failures, whose cause was the standard profile front page moving from /node to /user/login in Drupal 12. module_set_weight() no longer needs an inline PHPStan ignore either: #3616747: Remove reportUnmatchedIgnoredErrors from phpstan configuration replaced the calls in domain_access.install and domain_source.install with DeprecationHelper::backwardsCompatibleCall(), which uses the ModuleWeight service on Drupal 11.5 and later. A @todo marks that fallback for removal once the module requires ^11.5.
The 3.x branch carries the same decoration, where it is inactive on Drupal 11.1 and later. That is a separate issue: 3.x also supports Drupal 10.2, where library.discovery is still the LibraryDiscovery wrapper and the collector does not implement LibraryDiscoveryInterface, so the branch needs a service provider that picks the decorated service from the container rather than the plain rename done here.
AI-Generated: Yes (Claude Code was used to help draft this issue summary and to write the change and its test on the merge request. I reviewed and ran the work before posting it.)
Issue fork domain-3612547
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
Comment #2
mably commentedComment #3
mably commentedComment #5
mably commentedComment #7
mably commented