Issue #3616784: Use entity.domain.collection as the primary name of the domain listing route
Renames the domain listing route to entity.domain.collection, the name core derives from the collection link template, and keeps domain.admin as an alias of it. This reverses the direction set in [#3613844].
The route stays in domain.routing.yml: DefaultHtmlRouteProvider::getCollectionRoute() emits at most two permissions and this route requires three.
Not in this change
domain_alias.adminis left alone. It serves a listing scoped to one parent domain, and core has no parameterizedcollectionroute:EntityBase::urlRouteParameters()supplies no parameters for that relation, sotoUrl('collection')could never work for it.- The alias is not marked
deprecated:, and there is no compatibility layer for local tasks, local actions or menu links. Core defers the same flip pending [#3506653], and no released downstream project allowsdrupal/domain4.x, so each of them has to cut a constraint-widening release regardless. The issue summary has the measurements.
Backwards compatibility
Url::fromRoute('domain.admin') and RouteProviderInterface::getRouteByName('domain.admin') keep working through the alias. A local task, a local action, a menu link or a hook_help() implementation that compares the matched route name has to move to entity.domain.collection; seven base_route: domain.admin declarations across six contributed projects are affected. The menu link plugin id domain.admin is deliberately left unchanged, because those same projects declare parent: domain.admin.
Tests
- New
DomainListingRouteTest::testLocalTasks()asksLocalTaskManager::getLocalTasksForRoute('entity.domain.collection')for the tabs of the listing page. Seen to fail against the unrenamed code. DomainUrlTest::testAliasedRouteNameIsNotPathMatched(), renamed fromtestCollectionRouteIsNotPathMatched(), pins the new direction: the listing path matchesentity.domain.collection, anddomain.adminis its alias. Also seen to fail against the unrenamed code.DomainFormsTestnow asserts that the two tabs and the action link are present on the rendered listing page.
Verified against core 11.4.4: phpcs (--standard=Drupal with CI's extension list) clean, phpstan clean, DomainListingRouteTest 1/1 and DomainUrlTest 9/9 with 32 assertions. The functional suite runs on CI.