Home ›
Rebuild menu cache to force recognition of menus added while developing a moduleRebuild menu cache to force recognition of menus added while developing a module
Submitted by Benjamin Melançon on September 26, 2007 - 6:23pm
Rebuild menus so that menu items and callbacks defined through the menu system take effect while you are developing a module.
Resolution
The quick fix:
menu_rebuild
I know I posted about this before, and it took me five minutes to find.
Anyhow, this is useful during development to clear and rebuild the menu cache, so that your menus added to a module (hook_menu) actually will show up for you, without reinstalling the module or something stupid.
Then immediately remove your call to menu_rebuild!
Actually I got a 500 Internal server error. But it worked.
Searched words:
reindex menus
refresh menus
menu show up
drupal regenerate menus
remake menu items
Drupal
Comments
This would seem to be a bad
This would seem to be a bad way. Recommend you use the devel module, which gives you a link to clear menu cache.
Do NOT use the reset menus link though! That undoes all your custamizations.
Very interesting, i like
Very interesting, i like this website.
dldege: btw, what is the
dldege: btw, what is the easiest way to force a menu_rebuild in 6
[1:15pm] dldege: truncating the menu_router table doesn't work to well
[1:19pm] chx: add menu_rebuild to index.php
[1:19pm] chx: just before the menu_execute_active_handler
This is a popular question,
This is a popular question, and I feel the answer is not satisfactory yet:
On IRC:
I gave chx answer here.
hanumani said there wasn't a link in devel on 6 (all still in beta though).
Which version?
Which version are you talking about?
Drupal 6
.
Your solution does not work
Your solution does not work in all circumstances, for instance I clobbered the menu cache whilst I was manually uninstalling a module in development. I was locked out with a white screen until I tried
?q=admin/build/modules
That rebuilds and everything is ok.
You just saved my life. I was
You just saved my life. I was a newbie to Drupal and my installation crashed dawn once I installed a module, cause of a f*** max_memory_usage exception.
The result was that I could not access to some menus in my administration page... Then I put that function call in my theme file and it rebuilded routes and stuff to make it work like it was working before! Thank you!
Post new comment