Heine

  • home
  • drupal
  • about
Home

Why is a menu item from hook_menu not accessible?

  1. Is your module enabled?
  2. Whenever you make a change to your module's hook_menu implementation, you need to rebuild the router table by visiting admin/build/modules. The Devel module provides a block that has a menu rebuild shortcut.
  3. Does you hook_menu implementation return the menu item array?
  4. Is your hook_menu properly named as modulename_menu?
  5. Carefully check whether the array keys you use are correct. A common mistake is the use of 'page_callback' instead of the correct 'page callback'.
  6. Make sure that your hook_menu implementation is in the .module file, not an include file.
Average: 5 (4 votes)
‹ Implemented hook_block, now all blocks are gone up Why is my module's update hook not listed on update.php's selection form? ›
  • Printer-friendly version
  • Login to post comments

Thanks

kacz (not verified) — Thu, 06/05/2010 - 18:48

Even after two years of drupal development, this one bit me in the ass recently. Being stubborn I took an hour to try to figure it out on my own before giving in to google.

One would think Drupal would present some sort of error when trying to load a module with a menu hook misnamed...

thanks again

  • Login to post comments

Thank you

Allison Christiansen (not verified) — Wed, 12/05/2010 - 20:06

I am pretty new to drupal and I did not realize you had to go to admin/build/modules for it to start working. Any time I go to that page though, Apache crashes, but apparently it still worked. So thanks again :)

  • Login to post comments

Recent posts

  • In doubt? Read the specs!
  • About the Webform SA
  • Psalmen voor Altblokfluit
  • Unserializing user-supplied data, a bad idea
  • Planet Drupal past and current
more

Security reviews

  • Afraid custom code makes your site vulnerable?
  • You don't really trust that module you just downloaded from Drupal.org?

Sleep better after a security review.

Tags

bladmuziek blood donation blood supply CSRF Drupal Input Format modx MSM Performance Planet Drupal Security Varnish
more tags
  • home
  • drupal
  • about

Copyright © 2011 by Heine Deelstra. All rights reserved.