Problem/Motivation

After updating to Drush v13 the sanitize command is no longer working for us.

Running with -vvv I see the output:

[debug] Could not instantiate Drupal\registration\Drush\Commands\RegistrationSanitizeCommands: Too few arguments to function Drupal\registration\Drush\Commands\RegistrationSanitizeCommands::__construct(), 0 passed in /app/vendor/drush/drush/src/Runtime/ServiceManager.php on line 360 and exactly 4 expected

Using drush.services.yml was deprecated in Drush 12 and no longer works.

Autowiring was added in 12.5 - https://www.drush.org/12.x/dependency-injection/#autowire

The create method was added in 11.6 https://www.drush.org/12.x/dependency-injection/#create-method

Looking at https://www.drush.org/13.x/install/#drupal-compatibility people could still be using 11?

I'm not sure the best way for the module to support multiple drush versions here but I will add a MR with a fix for 11.6 onwards.

Steps to reproduce

- PHP 8.3, Drush 13 & registration module
- Run drush sql:sanitize
- Observe the commands provided by this module are not in the list

Proposed resolution

TBC

Remaining tasks

TBC

User interface changes

n/a

API changes

n/a

Data model changes

n/a

Command icon 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

ericgsmith created an issue. See original summary.

ericgsmith’s picture

Issue summary: View changes

ericgsmith changed the visibility of the branch 3470617-drush-13-compatability to hidden.

ericgsmith’s picture

Status: Active » Needs review
john.oltman’s picture

Assigned: Unassigned » john.oltman

Looks good, will test locally and assuming all good will get this merged - thanks for the work!

john.oltman’s picture

Title: Drush 13 compatability for sanitize commands » Drush 13 compatibility for sanitize commands

john.oltman’s picture

Assigned: john.oltman » Unassigned
Status: Needs review » Fixed

I messed up the commit message but this has been committed to 3.2.x and will be in the next release. Will release 3.2.1 this weekend.

john.oltman’s picture

Version: 3.2.x-dev » 3.3.x-dev
john.oltman’s picture

This has been released as part of https://www.drupal.org/project/registration/releases/3.3.0
Please use 3.3.x branch going forward.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.