Support Drush 15 and the Symfony 8.2 test browser on Drupal 12
Supports Drush 15 and the Symfony 8.2 test browser on Drupal 12: https://www.drupal.org/project/domain/issues/3642184
The next-major CI lane now installs drush/drush 15.x-dev (no DrushCommands, AutowireTrait, ConsoleDefinitionsEvent or formatters: only Symfony console commands through core's dr) and symfony/browser-kit 8.2.0-RC1.
Changes
- Drush commands: every command of domain (12) and domain_alias (5) is a Symfony console command in
src/Command, which core 11.4+ registers fordrand Drush 15. A thin subclass insrc/Drush/Commandsexposes it to Drush 13.7 and 14 (each Drush version finds it once);composer.jsondeclares the conflict with Drush before 13.7 that Drush documents for console commands. Names, aliases, arguments and options are unchanged.- Under Drush 13.7 and 14 the commands that print rows use Drush's own formatters (
DrushOutputTrait), so--format,--fields(keys or labels),--fieldand--filterbehave as before,domain:deletestill runs the handlers of thedomain-deleteDrush event, and the questions ofdomain:deleteanddomain:schemestill follow--yesand--no. - Under
drand Drush 15 they print with--format(table, json, yaml, csv) and--fields.
- Under Drush 13.7 and 14 the commands that print rows use Drush's own formatters (
- domain_access and domain_source declare their reassignable field with the new
hook_domain_command_fields(), which givesdomain:deleteits--content-assign/--source-assignoptions anddomain:infoits lines on every Drush version. It replaces their@hook option domain:deleteand@hook alter domain:infoimplementations; other modules using those Drush hooks should implementhook_domain_command_fields(). - Drush negotiation setting: a console command subscriber negotiates the domain under
drand Drush 15 (core's console dispatches through the Drupal dispatcher, command line only); the Drush 13.7/14 listener calls the same method. - Multi-host functional tests: since browser-kit 8.2, a cookie set without a Domain attribute only goes back to its host, so BigPipe sends its no-JS meta refresh on every test host;
DomainTestBase::checkForMetaRefresh()follows it on the page's host instead of the base URL, where BigPipe refused it as a loop. - phpstan:
DomainLanguageConfigFactoryOverride::getOverride()no longer needs a baseline entry that only matched before Drupal 12. The classes insrc/Drush(loaded by Drush 13.7 and 14 only) use Drush and Consolidation classes that Drush 15 removed: their "not found" errors are ignored there withreportUnmatched: false. - Deprecations:
domain.moduleanddomain_source.modulekeephook_hook_info()for the 11.x floor (core 11 still loadsMODULE.domain.incgroup files); the 11.5 deprecation of code in these two files is ignored by its exact message until the minimum core is 12.
Release notes
- The domain commands also run under core's
drand Drush 15. domain:delete --source-assignnow reassigns the Domain Source field (it read--content-assign), and the reassignment now changes the references (it changed nothing before).- An unknown domain in
--users-assign,--content-assignor--source-assignnow stopsdomain:deletewith an error instead of prompting or ignoring. domain:listand the other row outputs are no longer HTML-escaped.domain:add --validatenow creates the domain when its host answers 200 (it never saved it), anddomain:default --validatenow checks the host (it never did).--redirect=0ofdomain-alias:updateanddomain-alias:delete-bulknow turns the redirect off, or selects the aliases without one (it was ignored).- The domain commands need Drush 13.7 or later (
conflictincomposer.json). - Modules that extended the domain Drush commands with
@hook option domain:deleteor@hook alter domain:infoshould implementhook_domain_command_fields();@hook on-event domain-deletehandlers keep running on Drush 13.7 and 14.
Tests
DomainConsoleCommandsTest, DomainAliasConsoleCommandsTest and DomainAccessConsoleCommandsTest run the commands through core's console.command_loader; DomainDrushOutputTest runs Drush's own FormatterListener on the Drush subclasses (skipped without Drush 13.7/14), including --yes and --no; DomainDrushNegotiationTest covers the console subscriber and the Drush listener. Drush 13.8 and 14 discovery of all 17 commands and the listener was checked with Drush's own ServiceManager.
AI-Generated: Yes (Claude Code wrote the changes and this description. I reviewed them.)