But if, when viewing a node, I activate the overlay system using the admin menu, and reload (ctrl+r), the dpm/debug info is displayed inside the overlay.

I can't understand why it is happening. I'm clearing cache a lot, and on rare occations, I see some debug info. But I can see no pattering to why it is so. Any ideas?

Comments

borgewarvik’s picture

I think I have norrowed this down to dpm()-calls inside my preprocess-node.inc file. I get dpm() calls working from preprocess-page.inc.

marcoka’s picture

Assigned: Unassigned » fubhy
marcoka’s picture

Assigned: fubhy » himerus
WorldFallz’s picture

Title: dpm() and/or debug() gives no output » dpm() and/or debug() gives no output anywhere execept page.tpl.php or preprocess_page

yep-- i can confirm this also. For some reason calls anywhere but page.tpl.php or preprocess_page dont seem work (and work fine when other themes are used).

I've tried copying the page.tpl.php file to my subtheme and manually printing $messages but that doesn't seem to have any effect (other than printing the messages twice).

So far I've checked node.tpl.php/preprocess_node, comment.tpl.php/preprocess_comment, comment-wrapper.tpl.php, field.tpl.php, and a custom module specific hook as well.

With the insane amount of variables in d7 this is a huge problem when trying to figure out what variables to use.

Debug() doesn't work either.

WorldFallz’s picture

seems to work in the omega theme proper, but not the alpha.

himerus’s picture

Assigned: himerus » Unassigned
Status: Active » Postponed (maintainer needs more info)

I use a combination of krumo(), dpm(), drupal_set_message(), etc every day in almost every template/preprocess combination possible.

Perhaps for some reason the page you are trying to display it on just isn't rendering it because of some other module/settings?

tim-e’s picture

Using debug() works except when you need to debug a monstrous node object with multiple nested values. frustrating that dpm wont work.

marcoka’s picture

does dsm() work for you?

kendouglass’s picture

Same here. dpm() and/or debug() gives no output anywhere execept page.tpl.php or preprocess_page

dimduj’s picture

Suscribe

WorldFallz’s picture

@dimduj-- please see the 'follow' button at the top of the issue. Subscribing is no longer necessary.

charlus’s picture

I found a way to display the dsm in the preprocess node hook function.

In the preprocess_node hook function : create and set a global $preprocess_node_dsm, this global will be used in the process_zone hook function. Set this global to 0 when you don't need to dsm some data in the preprocess_node hook function

function YOUR_MODULE_preprocess_node(&$vars) {
  global $preprocess_node_dsm;
  $preprocess_node_dsm = 1;
  dsm($vars);  

You can use the hook_process_zone() in your custom template.php as follow :

/**
 * Implements hook_process_zone().
 */

function YOURTHEME_process_zone(&$vars) {
  
  global $preprocess_node_dsm;
  
  $theme = alpha_get_theme();
  
  if ($vars['elements']['#zone'] == 'content') {
    if (isset($preprocess_node_dsm) && ($preprocess_node_dsm))  $vars['messages'] = theme('status_messages');
    else                                                  $vars['messages'] = $theme->page['messages'];
    $preprocess_node_dsm = 0;
    $vars['breadcrumb'] = $theme->page['breadcrumb'];
  }

}
furamag’s picture

Following code works for me but it displays result inline:

  $export = kprint_r($vars, TRUE); // $vars - is a variable which you want to print.
  print $export;
eric constantinides’s picture

Issue summary: View changes

#13 worked like a charm.

frob’s picture

I just came across this.

For me this was with the paragraphs module. If I did tried to dpm anything from inside the paragraphs.theme.inc file template_preprocess_paragraphs_items function nothing would happen, If I did #13 it works.

vrwired’s picture

I found (at least on template.php) that simply including within the function (no need to print $export):
$export = kprint_r($vars, TRUE);
will allow for any other dsm() calls to print every time and *without resulting in inline format* but may need to clear cache on occasion

steinmb’s picture

Status: Postponed (maintainer needs more info) » Fixed

Status: Fixed » Closed (fixed)

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

opgobee’s picture

Same issue: dpm(), debug(), krumo(), drupal_set_message(), solution #13 all no output despite cache flushing from a Class definition in an .inc file in a module: in sites/all/modules/MODULENAME/plugins/***.inc. Normal output from a .module file, template.php etc.
How to get output?