Issue #3616863: Decorate the library discovery service the running core builds library info with (3.0.x backport)

Backport of !429 (merged) to the 3.0.x maintenance branch, which carries the same service definition and the same ^10.2 || ^11 core requirement.

DomainConfigServiceProvider::alter() reads the container rather than the core version: when the class of the library.discovery definition is a LibraryDiscoveryCollector, the domain_config definition is pointed at it with setDecoratedService(). Up to Drupal 11.0 nothing changes, since library.discovery is the LibraryDiscovery wrapper there and the collector does not implement Drupal\Core\Asset\LibraryDiscoveryInterface.

Two differences from the 3.x merge request, both because of the state of this branch:

  • The test module had no config schema directory, so the fixture the library hook reads is declared in a new domain_config_test.schema.yml.
  • domain_config still decorates language_manager here, so the kernel test installs the language module, like the other kernel tests on this branch.

It also gives DomainAccessDefaultValueAutocompleteTest a test group. The class carries none, and run-tests.sh on Drupal 10 throws MissingGroupException before running anything, so the previous major lane never got past discovery.

Verified on both cores this branch supports:

core with the service provider without it
10.6.15 OK (2 tests, 11 assertions) OK, unchanged
11.3.16 OK 2 failures

DomainConfigOverrideEditableTest and DomainConfigMigrationTest pass as well, phpcs with the CI standard is clean over the whole module, and phpstan reports no errors.

Merge request reports

Loading
Loading