Problem/Motivation
Five backward-compatibility fallbacks on 11.x call \Drupal::service() with an ID that does not exist. A caller that omits the new constructor argument gets a ServiceNotFoundException instead of the deprecation notice.
LibraryDiscoveryParser::__construct()requestslibraries.parsing_cacheinstead oflibrary.parsing_cache.YamlRouteDiscovery::__construct()requestsrouting.yaml_cache_collectorinstead ofrouter.yaml_cache_collector. Its$yamlCacheCollectorargument also has no default value, so omitting it throws anArgumentCountErrorbefore the fallback runs.ResourceObjectNormalizer::__construct()requestsentity_field_managerandentity_type_managerinstead ofentity_field.managerandentity_type.manager.WorkspaceAssociation::__construct()requestsworkspace.trackerinstead ofworkspaces.tracker.
The main branch has already removed these fallbacks, so only 11.x is affected.
Steps to reproduce
In a kernel test with the workspaces module enabled, run new WorkspaceAssociation(NULL);. It throws:
You have requested a non-existent service "workspace.tracker".
Constructing the other three classes without the deprecated argument fails the same way.
Proposed resolution
Use the correct service IDs, and give $yamlCacheCollector in YamlRouteDiscovery a NULL default.
I used AI assistance (Claude) to prepare this issue and the merge request, and I checked the result.
Issue fork drupal-3636525
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 #4
giuseppe87 commentedComment #5
giuseppe87 commentedComment #6
giuseppe87 commented