- Issue created by @mlncn
- πΊπΈUnited States mlncn Minneapolis, MN, USA
Ah, 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."
- πΊπΈUnited States mlncn Minneapolis, MN, USA
The 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. - π¬π§United Kingdom Dubs
@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.
drush batch_plugin:process example_cron_batch_plugin
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!
- π¬π§United Kingdom Dubs
@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 :-)