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.
This has really been driving me nuts. So itch, meet scratch.
In order to call debug(array())
I need to type debug(array(), '', TRUE)
. The TRUE
indicates that print_r
should be used instead of var_export
. Fair enough, but that empty string is necessary in order to get to the third argument, which is FALSE
by default.
So I propose that if the second argument is a Boolean
, just deal with it and use print_r
without a label.
Comment | File | Size | Author |
---|---|---|---|
#9 | make_debug_use-2174507-9.patch | 1.34 KB | alansaviolobo |
#7 | make_debug_use-2174507-7.patch | 1.34 KB | alansaviolobo |
#6 | debug-2174507-6.patch | 1.4 KB | tim.plunkett |
Comments
Comment #1
jessebeach CreditAttribution: jessebeach commentedComment #2
tim.plunkettWhy not just switch the param orders? I've never used the label, I use the print_r flag a lot. But i think this is almost more confusing.
Comment #3
BerdirI don't think we should mis-use an argument for something else.
I use the label quite a lot, helps when to identify things when you have a lot of debug statements.
Comment #4
jessebeach CreditAttribution: jessebeach commentedLet's set
$print_r
to be true by default then.Comment #6
tim.plunkettFine by me.
Comment #7
alansaviolobo CreditAttribution: alansaviolobo commentedreroll
Comment #9
alansaviolobo CreditAttribution: alansaviolobo commentedended up exporting a reversed patch.
Comment #14
marvil07 CreditAttribution: marvil07 commentedReroll seems fine and still applies.
Comment #15
tim.plunkettComment #16
alexpottCommitting under the reduced fragility provision of the beta evaluation. Committed 5d36a99 and pushed to 8.0.x. Thanks!