0

For some reason my DSM output is only occasionally showing up. Nothing significant is changing on the template I'm calling it from. It will show up, then on refresh go away, and randomly re-appear 10 refreshes later.

Any idea what can cause this behavior?

2
  • What template / function are you calling it from? For me, a dsm (which simply calls a dpm() function) appears when I refresh for the 2nd time. – Jukebox Sep 21 '11 at 23:14
  • From inside a page.tpl.php file. – Joren Sep 22 '11 at 17:41
3

Especially in templates files, dpm() doesn't show up, I'm not sure about the cause but I guess it's because the drupal_set_message() function is called earlier. So while working on templates I prefer using kpr(), it works the same way but print directly the krumo message into the page instead of using drupal_set_message.

2
  • Nice! This works. Is there any reason not to just use kpr over dsm all the time? – Joren Sep 22 '11 at 17:51
  • kpr() will most of the time be printed in the top of the site and it can be hidden by admin_menu for instance, otherwise I'm not sure there's a restriction or not, I personally like to have it in the message section but it's frustrating when you have to change for a kpr(). – tostinni Sep 22 '11 at 21:39
0

Does the page have any 404 errors? (You can check the browser's console, or your server's access_log). Sometimes 404 pages can eat the dsm() messages, see http://drupal.org/node/885896.

0

dpm() uses drupal_set_message(), which actually stores the message into the $_SESSION variable, and it's fetched from there on the next full page refresh. So any AJAX changes may not pick up things that have been written, and also the $_SESSION contents are occasionally destroyed by buggy behavior especially during logout.

0

You can find all the details about dsm() and kpr() here

1
  • the page your linking to does not exists – FLY Nov 30 '12 at 8:05

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.