Attached is a patch for a drush command to bulk generate URL aliases using the batch API. It's not quite working yet, but I think it's close. The structure of the array that is passed to batch_set() matches the bulk alias form from (admin/build/path/update_bulk), and I'm calling batch_process(), but the process isn't getting kicked off. I need to get this done by this weekend if possible, so I'm hoping someone can help me bring this to the finish line.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

wonder95’s picture

And here it is without my commented out code borrowed from pathauto_bulk_update_form_submit().

wonder95’s picture

It looks like the reason it isn't processing is that $batch['progressive'] is hardcoded to be TRUE (since I'm passing $batch in as an argument) in batch_process(), which then runs a drupal_goto(), which is a problem for drush, I would imagine. It looks like $batch['progressive'] needs to be set to FALSE so it can go to _batch_process() instead. However, even when I hack $batch['progressive'] = FALSE and that runs, I don't get any aliases re-generated in the url_alias table, although my CPU usage skyrockets.

Any suggestions as to how to address this?

Dave Reid’s picture

I'm pretty sure the built-in drush batch commands have them run in a non-progressive manner.

wonder95’s picture

Yeah, I had a major facepalm after I wrote that. I realized I don't need to go through any form functions at all.

xjm’s picture

Tracking.

Dave Reid’s picture

Issue summary: View changes
Status: Active » Closed (duplicate)
Related issues: +#867578: Add drush commands for bulk alias updating/deleting