I'm writing a small module and using the Devel print functions (dpr, kpr, dpm, etc.) to print out some values.

However, I only see the values in the page after I flush certain caches. if I just reload the page or go to it I see nothing. This is true for both the message-area and the regular debug print functions. Is this expected?

I am logged in as admin so I'd think ordinary page caching is off.

(This is in D7.)

  • It all depends on where your inserting your debug code as to whether or not it's cached. For example if your adding debug to a custom input filter then that will always be cached regardless of your admin user or not. Can you include an example function of where your adding the debug?
    – digital
    Jul 12, 2011 at 9:15
  • Thanks. It's in a hook: hook_field_widget_info_alter(). The idea is to augment an existing field widget. I'm just getting started, and am using the Devel print functions to see its arg. Jul 12, 2011 at 15:39
  • 1
    From what I can remember from D6 all field widgets are cached so it's possible that this is expected behaviour.
    – digital
    Jul 12, 2011 at 16:26
  • _info is definely cache for sure
    – iStryker
    Jul 12, 2011 at 16:37

1 Answer 1


hook_field_widget_info_alter() is cached. Follow these steps to Suppress caching (for development) or to use an external page cache

when developing for Drupal you might want to suppress all caching of data to make sure new hooks, theme functions, etc are recognized immediately.

This will have performance detriments, of course, so must not be used in production. To turn on this development mode, add the following to your Drupal 7 settings.php file:

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.