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.
The PHP convention has been to return FALSE on a failure and not 0. It seems like Drupal should do the same to be consistent. I also can't see any benefit to returning 0 instead of FALSE, and consistency is all the rage right now.
Patch will be submitted shortly.
Comment | File | Size | Author |
---|---|---|---|
#10 | batch_revert-270045-10.patch | 1.42 KB | yched |
#7 | drupal_270045.patch | 14.45 KB | drewish |
#6 | drupal_270045.patch | 247 bytes | drewish |
#4 | use_boolean_values.patch | 14.67 KB | Susurrus |
#2 | use_boolean_values.patch | 13.39 KB | Susurrus |
Comments
Comment #1
Susurrus CreditAttribution: Susurrus commentedAnother case where booleans should've been used, but an int was used instead was wrapped into this patch.
Comment #2
Susurrus CreditAttribution: Susurrus commentedCaught a few functions returning preg_match[_all], which gives us an integer, so that was cast to a bool. Not sure what the code styles are for casting, however.
Comment #3
Anonymous (not verified) CreditAttribution: Anonymous commentedPlease add the -p option to your cvs diff. I need to see the function names and that will do it for me. The construct of your cast looks similar to others I've seen within Drupal.
Comment #4
Susurrus CreditAttribution: Susurrus commentedHere's an updated one to use the -p option. Eclipse doesn't allow for this option...
Comment #5
drewish CreditAttribution: drewish commentedno longer applies, three or four hunks fail
Comment #6
drewish CreditAttribution: drewish commentedmy bad, it still applies. here's a clean re-roll.
Comment #7
drewish CreditAttribution: drewish commentedi'll try that again.
Comment #8
moshe weitzman CreditAttribution: moshe weitzman commentedOh yes. This has bugged me for a long long time.
Comment #9
Dries CreditAttribution: Dries commentedCommitted to CVS HEAD. Thanks.
Comment #10
yched CreditAttribution: yched commentedAttached patch reverses the batch.inc changes : $finished is indeed a float completion level, used to provide progress info on multi-pass operations. (added a small comment to make it clearer)
The changes didn't break anything (because 1 == TRUE, 0 == FALSE), but are misleading.
Comment #11
Dries CreditAttribution: Dries commentedCommited to CVS HEAD. Sorry, I should have spotted that.
Comment #12
keith.smith CreditAttribution: keith.smith commentedPutting in my tracker to add some periods after comments as a followup. Will adjust status when I have a patch.
Comment #13
keith.smith CreditAttribution: keith.smith commentedIgnore my comment #12; it was obviously late and I didn't see the second line of the comments which correctly contained full-stops.
Comment #14
Anonymous (not verified) CreditAttribution: Anonymous commentedAutomatically closed -- issue fixed for two weeks with no activity.