Drush 12 ArgumentCountError: Too few arguments to function

Created on 3 August 2023, over 1 year ago
Updated 29 June 2024, 6 months ago

Problem/Motivation

When running Drush 12, there is an error occurring where the appropriate arguments are not passed to the constructor function.
[error] ArgumentCountError: Too few arguments to function Drupal\duration_field\Drush\DurationFieldCommand::__construct(), 0 passed in /var/www/html/vendor/drush/drush/src/Runtime/ServiceManager.php on line 325 and exactly 3 expected in Drupal\duration_field\Drush\DurationFieldCommand->__construct() (line 51 of /var/www/html/web/modules/contrib/duration_field/src/Drush/DurationFieldCommand.php)

Steps to reproduce

Running Drupal 10 with Drush 12 and duration_field module enabled, simply run drush cr The above error should occur.

Proposed resolution

Change the drush command directory from ~/duration_field/src/Drush to ~/duration_field/src/Commands. Be sure to update the namespace in the class file and class name in the drush.services.yml file. (See attached patch file)

πŸ› Bug report
Status

RTBC

Version

2.0

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States peachez

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

Comments & Activities

Production build 0.71.5 2024