Problem/Motivation

Attempting to use drush cim or drush anything with Drush 12 errors fatally due to the change described here https://github.com/drush-ops/drush/issues/5626

The error message given is:

You have requested a non-existent parameter "config.import.commands".

Remaining tasks

Refactor usage of ConfigImportCommands to rely on the drush() utility function, https://github.com/drush-ops/drush/blob/12.x/src/Commands/config/ConfigC... or to use Drupal's APIs.

User interface changes

API changes

Data model changes

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

mlncn created an issue. See original summary.

trackleft2’s picture

mlncn’s picture

Status: Active » Needs review

Fantastic, thank you for this! Hoping someone can review before i get to it. Your notes on how to test are great too, thank you trackleft2.

joegraduate’s picture

Status: Needs review » Needs work

As far as I can tell, the Drush\Drupal\Commands\config\ConfigImportCommands dependency that is currently being injected into the ConfigSyncCommands class is not actually being used so I think the MR could be simplified a bit to just remove that dependency altogether rather than replace it with the new Config Distro service.

We may also want to hold off on merging this until after the related Config Distro issue is resolved (#3369336: Config Distro breaks with Drush 12, need to refactor not to use ConfigImportCommands).

joegraduate’s picture

joegraduate’s picture

Status: Needs work » Needs review

MR !10 is ready for review.

tadean’s picture

Thank you for your work on this! Tested out MR !10 locally with Drush 12.1.3. Verified the original issue:

$ drush config-sync-list-updates
In LegacyServiceInstantiator.php line 282:                       
  You have requested a non-existent parameter "config.import.commands". 

Verified that with the changes in MR !10 the error does not occur, and config_sync reports expected changes correctly:

$ drush config-sync-list-updates
 ----------------- ---------------- ----------------- 
  Extension         Operation type   Label            
 ----------------- ---------------- ----------------- 
  my_test_content   update           My Content Type  
 ----------------- ---------------- -----------------

config_sync tests pass:

PHPUnit 9.6.10 by Sebastian Bergmann and contributors.

Testing /usr/local/config_sync
....                                                                4 / 4 (100%)

There is one minor phpcs complaint about the create() function:
74 | ERROR | [x] Missing function doc comment (Drupal.Commenting.FunctionComment.Missing)

And one minor complaint about the $state. in the docblock of the constructor:
58 | ERROR | [x] Doc comment parameter name "$state." must not end with a dot (Drupal.Commenting.FunctionComment.ParamNameDot)
This error was unrelated and not introduced by this MR though.

joegraduate’s picture

joegraduate’s picture

Status: Needs review » Fixed

Merged. Thanks all!

Status: Fixed » Closed (fixed)

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