In the documentation for hook_update_N(), the parameter $sandbox is not documented (reported by flaviovs).
| Comment | File | Size | Author |
|---|---|---|---|
| #22 | 937560-d6-22.patch | 1.17 KB | albert volkman |
| #20 | 937560-d6-20.patch | 1.16 KB | albert volkman |
| #16 | 937560-d6-16.patch | 694 bytes | albert volkman |
| #10 | 937560-10.patch | 708 bytes | chrisparsons |
| #6 | 937560-6.patch | 645 bytes | chrisparsons |
Comments
Comment #1
jhodgdonI wouldn't exactly say it's not documented. The function doc says:
If your update task is potentially time-consuming, you'll need to implement a multipass update to avoid PHP timeouts. Multipass updates use the $sandbox parameter provided by the batch API (normally, $context['sandbox']) to store information between successive calls, and the $sandbox['#finished'] value to provide feedback regarding completion level.
This is missing from the Drupal 6 doc though, and should be added.
Comment #2
avpadernoWhat I mean is that the documentation is missing the section Parameters that is present, e.g., in hook_view().
Comment #3
jhodgdonOK. Someone can add an @param and say something like "see above". Should be done in D7 first. Then D6 needs the @param as well as the section quoted above that exists in D7 and is missing in D6.
Comment #4
jhodgdonGood project for a novice doc contributor
Comment #5
chrisparsons commentedComment #6
chrisparsons commentedAdded documentation for @param $sandbox.
Comment #8
chrisparsons commented#6: 937560-6.patch queued for re-testing.
Comment #9
jhodgdonHmm. How about "Stores information for multi-pass updates. See above for more information." or something slightly more illuminating?
Also, it looks like the test bot was randomly failing. If that is systemic (e.g. if it's always failing on a particular test), we might have an issue somewhere else in Drupal. We just fixed one of these over the weekend (a filter.test failure). So net time you queue for retesting, maybe you could also put a link in to the failed test results, so we can investigate? i.e. the URL linked to in "View details" in the testing line.
Thanks!
Comment #10
chrisparsons commentedI messed around with it a little bit, but kept coming back to your wording jhodgdon. Patch attached.
Comment #11
jhodgdonLooks good, thanks!
Comment #12
dries commentedCommitted to CVS HEAD. Thanks.
Comment #13
avpadernoThe patch should be ported to D6.
Comment #14
jhodgdonRight. See #3 above for what needs to be done. Thanks for remembering to set the status to "to be ported", kiamlaluno...
Comment #15
jhodgdonVersion wasn't changed. :)
Comment #16
albert volkman commentedD6 backport attached.
Comment #18
jhodgdonIgnore the test failure. The hook docs files are in the Documentation project, not the Drupal project, in D6. I'll see about applying it to Drupal 6 shortly. Thanks!
Comment #19
jhodgdonThis patch applies fine to the Drupal 6 documentation, but it isn't quite enough. In D7/8, the page tells what a "sandbox" is before you get to the @param $sandbox. But the D6 documentation does not have this information. So that needs to be ported from the D7/8 docs before we can say " See above for more information."
http://api.drupal.org/api/drupal/modules--system--system.api.php/functio...
Comment #20
albert volkman commentedAh, I should have read it closer. Updated.
Comment #21
jhodgdonThat's better! This one line needs to be shortened to less than 80 characters though:
Comment #22
albert volkman commentedFixed!
Comment #23
jhodgdonThat looks better. I've committed it to the Documentation project. Thanks!