5

I need to debug a D7 site from the anonymous user. What settings need to be changed to allow anonymous to view dsm(), dpm(), krumo(), etc. commands?

Note: I have already enabled Access developer information under the Devel module for all roles.

13

Give them Access developer information permission at admin/people/permissions.

Note that this opens a huge security risk so make sure you revoke it when you are done with debugging.

  • Already had that enabled for all roles... any other thoughts? – emc Apr 10 '13 at 0:58
  • Have you cleared the cache? Normally, enabling the permission is all you need to do. – Patrick Kenny Apr 10 '13 at 1:22
  • It could be the missing anonymous user as Vimalnath mentioned in the other reply. – AyeshK Apr 10 '13 at 13:12
2

To use drupal_set_message() for anonymous user, you need to have a uid= 0 in users table. Check in your users table with uid=0 record exists. If not create a user with uid = 0; Also, check here

  • That's a really interesting bug. Anonymous user 0 is present and accounted for... still no messages :( – emc Apr 10 '13 at 15:57
0

The Omega custom child theme was blocking messages from being printed.

Excerpt from zone--content.tpl.php:

<!-- zone--content.tpl.php -->
<?php if ($wrapper): ?><div<?php print $attributes; ?>><?php endif; ?>  
  <div<?php print $content_attributes; ?>>    
    <?php if ($breadcrumb && 0): // DISABLED! ?>
      <div id="breadcrumb" class="grid-<?php print $columns; ?>"><?php print $breadcrumb; ?></div>
    <?php endif; ?>    
    <?php if ($messages && $is_admin): ?>
      <div id="messages" class="grid-<?php print $columns; ?>"><?php print $messages; ?></div>
    <?php endif; ?>
    <?php print $content; ?>
  </div>
<?php if ($wrapper): ?></div><?php endif; ?>

Note the if ($messages && $is_admin) statement.

This is the correct answer for this particular case despite the lack of information provided in the initial question. Though the other answers provided are relevant and highly informative, this answer is selected to help future users troubleshoot.

Thanks everyone for your help!

0

If you have given the Access developer information permission to anon. user, make sure that the page you are accessing does not have any missing resources: images or anything that would result in status 404 being returned by the server.

While generating 404 response, the server calls drupal_get_messages() which effectively clears the Drupal message queue, resulting in $messages variable being empty when rendered in page.tpl.php .

0

Probably someone needs to debug a variable right away and want to have something like DPM for ONE particular anonymous user without giving the "Access developer information" to ALL anonymous users (which is a dangerous thing in production environment), then you can do this:

  if ($some_condition_is_true) {
      has_krumo();
      drupal_set_message(krumo_ob($my_var));
  }

Hope that helps!

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.