I'm getting a type error when trying to run drush cached-moderation-state:update-all with Drush 12

TypeError: Drupal\cached_moderation_state\Commands\CachedModerationStateCommands::runBatchInitializeStep(): Argument #4 ($context) must be of type DrushBatchContext, array given

Drush has removed the DrushBatchContext wrapper
https://github.com/drush-ops/drush/pull/5353

Proposed resolution

The type hit should be array, but that may break compatibility with older Drush versions. I think it will be better to remove the type hinting for now

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

matias created an issue. See original summary.

matias’s picture

Assigned: matias » Unassigned
Status: Active » Needs review

  • clayfreeman committed 1d60f81e on 1.1.x
    Issue #3417824 by matias: Remove DrushBatchContext type hints from...

  • clayfreeman committed 56dad3c1 on 1.0.x
    Issue #3417824 by matias: Remove DrushBatchContext type hints from...
clayfreeman’s picture

Status: Needs review » Fixed

Thanks for your contribution! I went ahead and tagged a patch release for this as well. Should be available for installation shortly.

clayfreeman’s picture

Status: Fixed » Closed (fixed)

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