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?

  • 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
    Commented Sep 21, 2011 at 23:14
  • From inside a page.tpl.php file.
    – Joren
    Commented Sep 22, 2011 at 17:41

4 Answers 4


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.

  • Nice! This works. Is there any reason not to just use kpr over dsm all the time?
    – Joren
    Commented Sep 22, 2011 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
    Commented Sep 22, 2011 at 21:39

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.


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.


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

  • the page your linking to does not exists
    – FLY
    Commented Nov 30, 2012 at 8:05

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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