Drupal: non-static method krumo::dump cannot be called statically

5th Aug 2011 // By Chris // Drupal Planet

If you are seeing the error "non-static method krumo::dump cannot be called statically" you might, like me, be wondering what the hell that means. Alternatively you might not even be seeing the error, or noticing that it's happening. Sometimes krumo output won't be all nice and clickable, like it usually is.

The problem looks a bit like this:

Screenshot of krumo problem

The issue's primary cause is that the style and script tags, containing the CSS and JavaScript that krumo needs, don't get added to the page (they're usually right above where the krumo output is in the markup).

Our issue was that we were running PHP 5.3 using E_STRICT (on strong recommendation from individuals such as Mr. Garfield), and it was only on closer inspection that we noticed this "non-static method krumo::dump cannot be called statically" error that was coming up, silently, behind the scenes. In a nutshell, the issue is the way that krumo is calling call_user_func_args on a method which was not declared as static. I am not sure if it was due to this function's changes in PHP 5.3, or the E_STRICT, but PHP did not like this.

Thankfully the solution is simple. This was fixed in devel 6.x-1.21 (and probably an equivalent release of devel for Drupal 7). You should just update your devel module to the latest (which, at the time of writing, is 6.x-1.26), and the issue will magically disappear.

That is, of course, if this was the cause of your issue. We've known krumo to fall over due to other reasons as well, but that's another story! However, if you do have any "quick fixes" for krumo going wrong, do let us know in the comments.

About The Author

Chris's Profile Picture
Chris

Chris Cohen is a seasoned web developer who began in Perl, before moving on to Java, C# and currently PHP and Drupal. He regularly attends DrupalCon and is "Certified to Rock" (certifiedtorock.com).

1

Comments

Kaloyan K. Tsvetkov's picture

I am very glad that you find my pet project Krumo this useful! Unfortunately I do not have the time to work on it in the last few years but I am glad that you manage to fix all its shortcomings on your own.

Post new comment

The content of this field is kept private and will not be shown publicly.

New job vacancies button

Categories

Search