Heine

  • Home
  • Drupal
  • About
Home » Guides » Drupal Developer FAQ

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. Check what access callback and access arguments are used.
  7. Make sure that your hook_menu implementation is in the .module file, not an include file.
‹ 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

Comments

Thanks

Submitted by kacz (not verified) on Thu, 2010/05/06 - 19: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

Thank you

Submitted by Allison Christiansen (not verified) on Wed, 2010/05/12 - 21: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 :)

Recent posts

  • Teampassword manager's password generator is biased
  • Other vectors for SA-CORE-2014-005?
  • Lazy loading: hook_hook_info is for hook owners only.
  • "Always offline" problem in EA's Origin due to antivirus
  • From bug to exploit - Bakery SSO
more

Security reviews

I provide security reviews of custom code, contributed modules, themes and entire sites via LimoenGroen.

Contact us for a quote.

Follow @ustima

Copyright © 2021 by Heine Deelstra. All rights reserved.

  • Home
  • Drupal
  • About