Loading
Backport the 4.x beta audit fixes to 3.0.x
Backports the fixes of https://www.drupal.org/project/domain/issues/3642166 (merged in 4.x) to 3.0.x.
What changes
- Domain: the default domain stays (it only moves when another domain becomes the default, after validation; delete, disable and "make an inactive domain the default" follow the domain's access rules, used by the list, the edit form, the inline route and the actions); no redirect of a domain to itself; saving a domain also clears cached non-HTML responses; the paths kept open on inactive domains are compared at request time; domain access varies by the domains the user administers (new
user.domain_admincache context); cache contexts of tokens and variable-scheme links; hostname, port and path prefix validation; the list only saves moved domains; server and navigation block fixes. - Domain Access: the Add/Remove domain bulk actions follow the access to the Domain Access field and the domains its widget offers, and check those domains once per operation; node access, create access, the views route check and the views access plugins vary by the user's domains (new
user.domain_accesscache context); grant settings flag a permissions rebuild; per-type permissions depend on their content type. - Domain Alias: the environment alias hostname is never saved into a domain;
getDomain()finds the parent domain; one alias lookup per hostname; alias changes clear cached responses; port validation. - Domain Config UI: disable, destination and inspect fixes.
- Domain Content: the overviews vary by the user's domains and follow the domain, content and user lists.
- Domain Source: the "Active domain" views filter varies by domain, with a post update for saved views.
Differences from 4.x
- 3.0.x has neither Domain Config Language nor the 3.x migration: those fixes are not part of this merge request. Saving a domain or an alias keeps invalidating the tags it did, plus
http_response. - The
execute()signatures of the domain actions and the constructors stay as they are on 3.0.x. getOriginal()and the node access rebuild service are only used on the cores that have them (11.2 and 11.4); older cores use the property andnode_access_needs_rebuild().- The previous default domain is found by an ID query, without loading every default domain: loading domains while saving one made domain_alias negotiate the active domain too early (
DomainAliasHostnameTest). - The domain_source post update saves each view itself: before Drupal 11,
ConfigEntityUpdatersaves trusted data, which a view saves without computing its cache contexts.
Tests
The kernel tests of #3642166, adapted to 3.0.x, and a 3.0.x DomainConfigInlineActionTest. All kernel suites pass locally on Drupal 11.4.
AI-Generated: Yes (Claude Code ported the fixes and their tests, and wrote this description. I reviewed them.)
Edited by Frank Mably