Resetting Drupal's menu cache
Hi all, I've noticed that when you make a change to your MODULE_menu hook, that you need to disable and re-enable the module before the changes are made effective. This is fine for my module because I can do that, but I want to make a change to a core module (for example, make the weight of Logout 1000 so it is always at the bottom). The menu module is a core module and cannot be disabled, so how do I reset this menu cache for core modules? -Matt
Just clear the cache_menu table in the database. If you're on D6 this can be done on the 'performance' page in the admin section. Otherwise just resubmitting the modules page should work(?) Regards Steven Jones On Fri, Jun 27, 2008 at 3:32 PM, Matt Connolly <matt@cabinetuk.com> wrote:
Hi all,
I've noticed that when you make a change to your MODULE_menu hook, that you need to disable and re-enable the module before the changes are made effective.
This is fine for my module because I can do that, but I want to make a change to a core module (for example, make the weight of Logout 1000 so it is always at the bottom).
The menu module is a core module and cannot be disabled, so how do I reset this menu cache for core modules?
-Matt
Thanks. Clearing cache data at the very bottom of the performance page did the trick. The question was originally because you cannot disable core modules, such as "menu.module". Thanks again, Matt On 27/06/2008, at 3:36 PM, Steven Jones wrote:
Just clear the cache_menu table in the database. If you're on D6 this can be done on the 'performance' page in the admin section. Otherwise just resubmitting the modules page should work(?)
Regards Steven Jones
On Fri, Jun 27, 2008 at 3:32 PM, Matt Connolly <matt@cabinetuk.com> wrote:
Hi all,
I've noticed that when you make a change to your MODULE_menu hook, that you need to disable and re-enable the module before the changes are made effective.
This is fine for my module because I can do that, but I want to make a change to a core module (for example, make the weight of Logout 1000 so it is always at the bottom).
The menu module is a core module and cannot be disabled, so how do I reset this menu cache for core modules?
-Matt
Matt Connolly wrote:
Thanks.
Clearing cache data at the very bottom of the performance page did the trick.
The question was originally because you cannot disable core modules, such as "menu.module". Um, yes, you can disable menu module. Just uncheck the box. :P In any case, it is not necessary - simply resubmitting the modules administration page will cause the menu cache to rebuild, which will affect /all/ modules, not just the ones disabled/re-enabled.
Also, in what case would you have changes to menu_menu()? It is a core module - its code should not be changed.
case, it is not necessary - simply resubmitting the modules administration page will cause the menu cache to rebuild, which will affect /all/ modules, not just the ones disabled/re-enabled.
Simply visiting the modules admin page cause everything to rebuild in Drupal 6. The menu cache in Drupal 6 is not that relevant. The router table is, but if you are frequently rebuilding that, even during development, then ask yourself "do I have separate router items here or I forgot about the menu_links table and menu_link_save?"
My understanding is that you need to visit the Module settings page for menu changes to take effect in d6 (/admin/build/modules). Matt Connolly wrote:
Hi all,
I've noticed that when you make a change to your MODULE_menu hook, that you need to disable and re-enable the module before the changes are made effective.
This is fine for my module because I can do that, but I want to make a change to a core module (for example, make the weight of Logout 1000 so it is always at the bottom).
The menu module is a core module and cannot be disabled, so how do I reset this menu cache for core modules?
-Matt
Matt, I'm pretty sure you truncate the cache_menu table in the db. Shai On Fri, Jun 27, 2008 at 10:32 AM, Matt Connolly <matt@cabinetuk.com> wrote:
Hi all,
I've noticed that when you make a change to your MODULE_menu hook, that you need to disable and re-enable the module before the changes are made effective.
This is fine for my module because I can do that, but I want to make a change to a core module (for example, make the weight of Logout 1000 so it is always at the bottom).
The menu module is a core module and cannot be disabled, so how do I reset this menu cache for core modules?
-Matt
In Drupal 5, just truncate cache_menu. In Drupal 6, you do have to visit the modules page, or go to the Performance page and hit the clear cache button. I tend to find the latter works better. That said, it sounds from your message like you're editing a core module directly. *Do not do that!* In Drupal 6, use hook_menu_alter() to change the weight of a menu item. Then you can just hit the cache clear button and it will rebuild the menu index. --Larry Garfield On Fri, 27 Jun 2008 15:32:52 +0100, Matt Connolly <matt@cabinetuk.com> wrote:
Hi all,
I've noticed that when you make a change to your MODULE_menu hook, that you need to disable and re-enable the module before the changes are made effective.
This is fine for my module because I can do that, but I want to make a change to a core module (for example, make the weight of Logout 1000 so it is always at the bottom).
The menu module is a core module and cannot be disabled, so how do I reset this menu cache for core modules?
-Matt
participants (7)
-
Aaron Winborn -
Charlie Gordon -
Karoly Negyesi -
Larry Garfield -
Matt Connolly -
Shai Gluskin -
Steven Jones