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');

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

jhodgdon’s picture

Title: Documentation problem with Batch operations » Batch operations example needs redirect
Issue tags: +Novice

Good idea. I think the redirect should actually be put into the batch_set array though, as it's clearer what's going on then.

barbi’s picture

batch_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) ?

jhodgdon’s picture

Hm. 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. :)

barbi’s picture

Assigned: Unassigned » barbi
Status: Active » Needs review
FileSize
1001 bytes
jhodgdon’s picture

Status: Needs review » Needs work

It 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

barbi’s picture

Status: Needs work » Needs review
FileSize
584 bytes

Yes, that diff was from a earlier patch. Sorry about that.
I pulled from the repo again, added the comment and re-rolled the patch.

jhodgdon’s picture

Version: 6.x-dev » 8.x-dev
Status: Needs review » Active
Issue tags: +Needs backport to D6, +Needs backport to D7

Looks 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.

barbi’s picture

Status: Active » Needs review
FileSize
587 bytes

Find patch attached for D8.
Comment 8 is for D8 and comment 6 is for D6.

jhodgdon’s picture

Status: Needs review » Reviewed & tested by the community

#8 looks good for Drupal 8/7 thanks! Then please set to RTBC/Drupal 6, where we already have a patch (#6). Thanks!

webchick’s picture

Status: Reviewed & tested by the community » Fixed

Committed and pushed to 8.x and 7.x. Thanks!

webchick’s picture

Version: 8.x-dev » 6.x-dev
Status: Fixed » Reviewed & tested by the community
Issue tags: -Needs backport to D7

Bleh. Sorry!

jhodgdon’s picture

Issue tags: +Needs backport to D7
FileSize
584 bytes

Re-attaching barbi's D6 patch from #6 above, which is RTBC for Drupal 6.

jhodgdon’s picture

Issue tags: -Needs backport to D7

cross-post! :)

Gábor Hojtsy’s picture

Status: Reviewed & tested by the community » Fixed

Thanks, committed, pushed.

Status: Fixed » Closed (fixed)
Issue tags: -Needs backport to D6, -Novice

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