Early Bird Registration for DrupalCon Portland 2024 is open! Register by 23:59 PST on 31 March 2024, to get $100 off your ticket.
Using dpm() in the D7 version of the module with PHP 5.3 with E_STRICT on floods pages with errors of this sort before the Krumo output is visible:
- Strict warning: call_user_func_array() expects parameter 1 to be a valid callback, non-static method krumo::dump() should not be called statically in krumo() (line 1276 of /Users/garrett/Drupal/contributions/modules/devel/krumo/class.krumo.php).
- Strict warning: Non-static method krumo::_debug() should not be called statically in krumo::_debug() (line 548 of /Users/garrett/Drupal/contributions/modules/devel/krumo/class.krumo.php).
- Strict warning: Non-static method krumo::_css() should not be called statically in krumo::_css() (line 564 of /Users/garrett/Drupal/contributions/modules/devel/krumo/class.krumo.php).
…and so on for just about every function of the Krumo class, some repeated a few times. Clearly a fault with Krumo more than the actual devel module, but for others who are annoyed by this, here's a quick-and-dirty patch.
Comment | File | Size | Author |
---|---|---|---|
#6 | devel_krumo.patch | 132.21 KB | drewish |
#2 | 694308_krumo_static.patch | 8.22 KB | Island Usurper |
krumo-static-functions.patch | 2.96 KB | Garrett Albright | |
Comments
Comment #2
Island Usurper CreditAttribution: Island Usurper commentedUnified diffs are better.
Comment #3
grendzy CreditAttribution: grendzy commentedI haven't reviewed the code, but this fixed it for me - before the patch dpm() would just crash PHP, either by exceeding the memory limit (starting with 512M) or just closing the connection.
Raising the priority, because at least on 5.2.9 dpm() is unusable.
Comment #4
JohnAlbinYOU GUYS JUST SAVED MY FUCKING DRUPALCON PRESENTATION.
The flood of warnings was taking 45 seconds to render and making it impossible to do a decent code-based demo.
Comment #5
drewish CreditAttribution: drewish commentedwe should probably preserve the indenting on the original library... did we check upstream and see it's been patched there? it seems like we're using an older version of it. the new Krumo 0.2.1a is PHP5 only. i propose updating to the newer version.
Comment #6
drewish CreditAttribution: drewish commentedhere's an update that tries to reapply the devel module changes.
Comment #7
drewish CreditAttribution: drewish commentedthe only feature i haven't been able to sucessfully test is the backtrace listing
Comment #9
drewish CreditAttribution: drewish commentedOkay committed the PHP5 code to HEAD since 7 requires it. Moving this to 6 to see if we want to backport or what.
Comment #10
Garrett Albright CreditAttribution: Garrett Albright commentedFWIW, I've never seen this issue happen in D6. I don't think a backport is necessary.
Comment #11
moshe weitzman CreditAttribution: moshe weitzman commentedThanks for upgrading us, drewish. If anyone knows whats new and relevant for us in new krumo, please post here.
Comment #12
drewish CreditAttribution: drewish commentedGarrett Albright, are you running PHP 5.3? I think it might be the only version that complains.
moshe weitzman, based on the diffs it was just adding Static to each function declaration. there were some other docs changes and whitespace but that was really it. i was just trying to keep us as close to upstream as possible. i reapplied all the drupal specific changes and added a comment to the only one i found with out a specific comment that it had changed from the original.
Comment #13
Garrett Albright CreditAttribution: Garrett Albright commentedYes, as I stated in the OP of this issue. :P
Sorry for the n00bish patch fail in that OP, by the way.
Comment #14
jwilson3I'm getting this on D6, PHP 5.2.12, with the recommended development server settings in php.ini:
error_reporting = E_ALL | E_STRICT
I can confirm that this patch in #2 applies cleanly on latest Devel release for D6 (6.x-1.22) and indeed fixes the strict warnings.
Comment #15
Chemtox CreditAttribution: Chemtox commentedGot this with Drupal 6, PHP 5.3. Kind of weird, it only appeared after installing Node Import:
PHP Strict Standards: Non-static method krumo::_css() should not be called statically in /etc/drupal/6/sites/all/modules/node_import/node_import.inc on line 1971
But even after disabling it, it kept on going:
PHP Strict Standards: Non-static method krumo::_dump() should not be called statically in /etc/drupal/6/sites
/all/modules/devel/krumo/class.krumo.php on line 972
Quick Perl fix: perl -pi -e 's/Function/static Function/g if ! /Function krumo/;' krumo/class.krumo.php
Comment #16
Chemtox CreditAttribution: Chemtox commentedComment #17
drewish CreditAttribution: drewish commentedcommitted the patch from #2 to 6.x-1.x