Heine

  • home
  • drupal
  • drupal core commits
  • 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 (2 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

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

  • reply

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 :)

  • reply

Post new comment

I reserve the right to edit any comment submitted to the site. If your comment contains flaming, advertisements, or simply too many spelling errors (leet speak), it may never appear.
The content of this field is kept private and will not be shown publicly.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd> <blockquote>
  • Lines and paragraphs break automatically.
  • You can enable syntax highlighting of source code with the following tags: <code>, <blockcode>, <as>, <as3>, <csharp>, <diff>, <drupal5>, <drupal6>, <html>, <js>, <mysql>, <php>, <phpbrief>, <python>, <sql>, <plain>, <xml>. Beside the tag style "<foo>" it is also possible to use "[foo]". PHP source code can also be enclosed in <?php ... ?> or <% ... %>.

More information about formatting options

Recent posts

  • Planet Drupal past and current
  • Help! - Cannot access a global variable.
  • Why is my module's update hook not listed on update.php's selection form?
  • How do I add a class to a link generated with l()
  • ZeroDayScan - Full path disclosure bug in Drupal 6.16 (0day)
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

Captcha CSRF Drupal embed Input Format modx OpenID Performance Planet Drupal rants Security Varnish
more tags
  • home
  • drupal
  • drupal core commits
  • about

Copyright © 2010 by Heine Deelstra. All rights reserved.