Drush 13 compatibility for sanitize commands

Created on 28 August 2024, 5 months ago
Updated 8 September 2024, 4 months ago

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

πŸ“Œ Task
Status

Fixed

Version

3.3

Component

Registration Core

Created by

πŸ‡³πŸ‡ΏNew Zealand ericgsmith

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

Production build 0.71.5 2024