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.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Status: Needs review » Needs work

The last submitted patch, krumo-static-functions.patch, failed testing.

Island Usurper’s picture

Status: Needs work » Needs review
FileSize
8.22 KB

Unified diffs are better.

grendzy’s picture

Priority: Minor » Normal

I 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.

JohnAlbin’s picture

Status: Needs review » Reviewed & tested by the community

YOU 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.

drewish’s picture

Status: Reviewed & tested by the community » Needs work

we 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.

drewish’s picture

Status: Needs work » Needs review
FileSize
132.21 KB

here's an update that tries to reapply the devel module changes.

drewish’s picture

the only feature i haven't been able to sucessfully test is the backtrace listing

Status: Needs review » Needs work

The last submitted patch, devel_krumo.patch, failed testing.

drewish’s picture

Version: 7.x-1.x-dev » 6.x-1.x-dev
Status: Needs work » Patch (to be ported)

Okay committed the PHP5 code to HEAD since 7 requires it. Moving this to 6 to see if we want to backport or what.

Garrett Albright’s picture

FWIW, I've never seen this issue happen in D6. I don't think a backport is necessary.

moshe weitzman’s picture

Thanks for upgrading us, drewish. If anyone knows whats new and relevant for us in new krumo, please post here.

drewish’s picture

Garrett 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.

Garrett Albright’s picture

Garrett Albright, are you running PHP 5.3? I think it might be the only version that complains.

Yes, as I stated in the OP of this issue. :P

Sorry for the n00bish patch fail in that OP, by the way.

jwilson3’s picture

Status: Patch (to be ported) » Reviewed & tested by the community

I'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.

Chemtox’s picture

Version: 6.x-1.x-dev » 6.x-1.23

Got 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

Chemtox’s picture

Version: 6.x-1.23 » 6.x-1.x-dev
drewish’s picture

Status: Reviewed & tested by the community » Fixed

committed the patch from #2 to 6.x-1.x

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.