The Devel module query log doesn't appear in a custom theme
Asked Answered
N

1

8

The Devel module query log appears correctly (at the bottom of the page) when I use one of the default themes, but not when I switch to my custom theme. The query log seems to appear within the inner pages in the custom theme, though not the front page or administrator pages (if those are set to use the custom theme).

I have been through page.tpl.php and html.tpl.php and I can't see any missing variables.

How does the query log get printed on the page?

Natalyanataniel answered 8/1, 2018 at 10:21 Comment(8)
Did you add the block in your custom theme? Structure => BlocksGeniegenii
There is no block for this. I can remove all blocks from the theme (apart from the required content one) and it still shows up in the system theme and not in the custom theme.Natalyanataniel
You need to check 'Collect query info' in the devel settings: admin/config/development/devel Also go through the permissions of the user that you are checking. Make sure you are checking with adminSwinney
Permissions are OK, settings are OK.Natalyanataniel
Do you use different templates for the pages where it shows or doesn't show? Might be something missing there?Geniegenii
Yep, the custom theme is a custom template, but as stated above I can't see anything missing.Natalyanataniel
How are you actually logging? dpm($variable)? Did you ensure to print $messages in your custom theme?Tyranny
There already are lots of answers over on DA drupal.stackexchange.com/q/24217/15055Tyranny
G
0

STEP 1:

Check in your template.php you can find the next hooks. If it doesnt exists, create it.

function YOURTHEME_preprocess_node(&$variables) {
  $variables['messages'] = theme('status_messages');
}

function YOUTRHEME_status_messages($variables) {
  
  $m = drupal_get_messages();

  foreach ($m as $type => $messages) {
    if (count($messages) > 0) {
        $output .= "<div class=\"messages\">";
          $output .= " <ul>";

            foreach ($messages as $key => $message) {

              if (count($messages) > 0) {
                $output .= '<li class="message '.$type.'"><span class="text">'. $message . "</span></li>";
              }
            }

          $output .= " </ul>";
        $output .= "</div>";
    }
  }
  return $output;
}

STEP 2 In your template check if var $message is printed. If it doesnt exists, create it.

print $message;
Gayton answered 13/5, 2021 at 9:53 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.