Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
API page: http://api.drupal.org/api/drupal/includes--form.inc/group/batch/6
Describe the problem you have found:
The first example should read:
//Indicate the page where it should go at the end of the batch
//otherwise the batch will loop
batch_process('node/1');
Comment | File | Size | Author |
---|---|---|---|
#12 | batch_example-1100260-6.patch | 584 bytes | jhodgdon |
#8 | batch_example-1100260.8.patch | 587 bytes | barbi |
#6 | batch_example-1100260-6.patch | 584 bytes | barbi |
#4 | batch_example-1100260-4.patch | 1001 bytes | barbi |
Comments
Comment #1
jhodgdonGood idea. I think the redirect should actually be put into the batch_set array though, as it's clearer what's going on then.
Comment #2
barbi CreditAttribution: barbi commentedbatch_set does not seem to have a redirect parameter, although it would be good to have it.
Should it be set in batch_process($redirect) ?
Comment #3
jhodgdonHm. If you look at the code in batch_process(), you'll see that it adds the redirect to the $batch that was set with batch_set(), using array addition. So it can actually be added in batch_set()....
But it doesn't actually look like that is done in any of the core functions that call batch_set(). Probably my comment in #1 should be ignored. :)
Comment #4
barbi CreditAttribution: barbi commentedComment #5
jhodgdonIt looks like you have two issue fixes in the same patch? Please limit the changes to this issue. I think that the other fix is in a different patch that hasn't been committed to Drupal 6 yet, but I'm not sure...
And can you also add a comment to the batch_process() line to indicate that it's being redirected? And preferably replace the comment that is there with a properly-formatted comment. :)
http://drupal.org/node/1354#inline
Comment #6
barbi CreditAttribution: barbi commentedYes, that diff was from a earlier patch. Sorry about that.
I pulled from the repo again, added the comment and re-rolled the patch.
Comment #7
jhodgdonLooks OK to me, thanks!
Oops, sorry I didn't notice this before, but this is a Drupal 6 issue, but it's the same doc in D7/8. So we should fix this there first, then go back to the patch in #6 for Drupal 6.
Comment #8
barbi CreditAttribution: barbi commentedFind patch attached for D8.
Comment 8 is for D8 and comment 6 is for D6.
Comment #9
jhodgdon#8 looks good for Drupal 8/7 thanks! Then please set to RTBC/Drupal 6, where we already have a patch (#6). Thanks!
Comment #10
webchickCommitted and pushed to 8.x and 7.x. Thanks!
Comment #11
webchickBleh. Sorry!
Comment #12
jhodgdonRe-attaching barbi's D6 patch from #6 above, which is RTBC for Drupal 6.
Comment #13
jhodgdoncross-post! :)
Comment #14
Gábor HojtsyThanks, committed, pushed.