In my custom module, I use a hook_init() with a dpm-function.

function mymodule_init() {

but for some reason, my page shows 2 times 'check' on the page... Is this default Drupal behavior? And if so, what are the reason for this behavior?

  • it should appear only once, cleared cache? Try this way and see what happends? drupal_set_message("check",'ok', false);
    – Vimalnath
    Commented Jun 26, 2013 at 8:05
  • Ofcourse with the false parameter, the message shows only once. But I would like to know why the message is showing twice even though it only should appear once in hook_init()
    – Michiel
    Commented Jun 26, 2013 at 8:19
  • This answer from this question drupal.stackexchange.com/questions/36265/… should be able to answer your question.
    – 4life
    Commented Jun 26, 2013 at 8:36

1 Answer 1


hook_init runs once per-page request, for non-cached pages.

See _drupal_bootstrap_full


I guess what's perhaps happening in your case is an additional ajax request is bootstrapping Drupal and triggering an additional hook_init call.

  • 3
    I believe this is often the case with admin menu.
    – Letharion
    Commented Jun 26, 2013 at 8:58
  • 1
    Could also be a 404 from a linked asset on the page.
    – mpdonadio
    Commented Jun 26, 2013 at 10:16

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.