#3631129 DomainSourcePathProcessor treats <current> as the route of the path since Drupal 11.4 (3.x backport)

Backport of !477 (merged) (#3631129) to 3.x.

On core 11.4 the URL generator passes <current> as the route name, which none of the processor's filters can match. DomainSourcePathProcessor::getRouteName() returns the current route's name for <current>, so the exclusion check and the entity lookup see the real route. current_route_match is injected; the class is @internal and autowired on 3.x as on 4.x. On core below 11.4 nothing changes: the generator passes no route name and DomainSourceRouteMatcher still resolves it from the path.

The test differs from 4.x: it carries @group domain_source (core 10's test discovery requires it) and overrides register() so that domain_source.route_provider extends the real route provider that kernel tests keep as test.router.route_provider. Before core 11.4 the processor reaches DomainSourceRouteMatcher, whose provider cannot be built from the argument-less provider kernel tests put in place.

Locally: DomainSourceCurrentRouteTest passes on core 11.4 and on Drupal 10.6, and fails without the fix on 11.4 ('/node/1'); all domain kernel classes pass on 11.4; phpcs and phpstan clean. CI: every job green including phpunit (previous major).

AI-Generated: Yes (Claude Code was used to help backport the fix and its test and to write this description. I reviewed them, and the test was confirmed to fail on 3.x without the fix and to pass with it.)

Edited by Frank Mably

Merge request reports

Loading
Loading