How to rebuild menu_links table and rebuild the navigation menu

| | 1 min read

In Drupal 6, when you are working on a new project and when you change menu items from MENU_NORMAL_ITEMS to MENU_LOCAL_TASK or vice versa you will run into a scenario where the menu_links table entries won't get changed. This can get reflected in menu_links not appearing in your system_admin_menu_block_page listing if you are using it for listing your menu items in a page. The solution is to rebuild the menu_links table for the menu items corresponding to your menu_router items.

The solution is simple.

  • First empty the menu_links table of navigation menu entries
    DELETE FROM menu_links WHERE menu_name='navigation'
  • Then go to your modules listing page at admin/build/modules and save the page.

You should be done. Make sure that you take a backup of your menu_links table before you play with DELETE commands :-)