Early Bird Registration for DrupalCon Portland 2024 is open! Register by 23:59 UTC on 18 March 2024, to get $100 off your ticket.
The dpm() function and consorts currently do not return anything. To ease debugging it would be helpful to simply return the original input value, which would allow debugging inside code statements where currently copy-pasting code is required. E.g. the following would become possible:
// Debugging inside if() statements:
if (dpm(function_result_to_check()) || dpm(another_function())) { …
// Debugging return values without having to copy-paste first:
return dpq(db_select(…)->fields(…)->execute());
Comment | File | Size | Author |
---|---|---|---|
#2 | transparent_dpm.1226482.2.patch | 2.18 KB | salvis |
#1 | devel-chainable-1226482.patch | 2.02 KB | smk-ka |
Comments
Comment #1
smk-ka CreditAttribution: smk-ka commentedLike this.
Comment #2
salvisGreat idea, this has bothered me, too.
However, have you tried your example?
This returns the SQL string rather than the $query object.
I'd suggest doing it this way.
Comment #3
salvisWell, I want to have this!
Committed #2 to D8/D7. Thanks!