Closed (fixed)
Project:
Batch Plugin
Version:
2.0.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
26 Aug 2025 at 23:28 UTC
Updated:
28 Aug 2025 at 18:04 UTC
Jump to comment: Most recent
With Drush 13.6.2 after enabling the module along with a module implementing a plugin, and even after repeated cache reloads, trying to run drush batch_plugin:process anything returns 'There are no commands defined in the "batch_plugin" namespace.' and trying to run drush bpp returns "Command "bpp" is not defined."
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
Comment #2
mlncn commentedAh, Drush 13 changed things up: "Drush 13 expects commandfiles to use Autowire to inject Drupal and Drush dependencies. Prior versions used a drush.services.yml file which is now deprecated and will be removed in Drush 13."
https://www.drush.org/13.0.0/commands/
Comment #3
mlncn commentedComment #4
mlncn commentedThe commands can be seen and run. The main need seemed to be the
drush.services.yml, which is not supposed to be needed since Drush 13, but there is documentation and then there is what actually works. I'm still getting errors ("> [warning] Undefined array key "success" batch.inc:229; [error] Error: Call to a member function claimItem() on null in _drush_batch_worker() (line 242 of /var/www/html/vendor/drush/drush/includes/batch.inc) #0 /var/www/html/vendor/drush/drush/includes/batch.inc(204): _drush_batch_worker()"), but that might be with my plugin not the new Drush implementation.Comment #5
dubs commented@mlncn - thanks for forking and fixing this. I've merged a modified version of your code which used a trait to allow support for older versions of drush.
I can't see anything wrong with your plugin code. The error suggests that the item isn't there, which is odd.
Try running this command (enable the example module), and let me know if you get the same issues. If you do, feel free to open a new issue.
I've tested here on a sandbox and a few sites we have live with this, and it's all good with no errors or warnings.
Thanks again for the fix!
Comment #6
dubs commentedComment #7
dubs commentedComment #8
dubs commented@mlncn, so I couldn't help myself and downloaded your module. Tested it and I got the same error. It's because $this->operations was an empty array. I've fixed that in the Cron processor. Checkout version 2.0.5 :-)