While working on the layout of a new custom menu, I discovered that the hook_menu process is not working on my D7.12 local site. As a test I enabled the Menu_example module and found that it will not generate menu items in the navigation menu, although it did a week or two ago. So far I have reinstalled all Drupal 7.12 files and confirmed that the module file hook_menus are being read (using dsm). I am at a loss as to what else can be preventing the menu links from being installed.
Does anyone have any similar experiences or suggestions on how to track this problem down to its source?
EDIT: This code does not add a menu item in an empty menu called "Stuff":
function material_menu_menu (){
$items['stuff/existing'] = array(
'title' => '020000 Existing',
'page callback' => 'material_view' ,
'page arguments' => array ('sum' , '020000 '),
'type' => MENU_NORMAL_ITEM,
'menu_name' => 'Stuff',
'access callback' => TRUE,
'weight' => '2 ');
return $items;
}
menu_name
would normally be case sensitive so it should be'stuff'
rather than'Stuff'
to match up with the menu's machine name. Also your code above doesn'treturn $items;
...could either of these be the problem?_menu_navigation_links_rebuild()
which builds up the menu links...it gets passed the menu router items built up frommenu_router_build()
(which is wherehook_menu()
is called from). A bit of temporary debug code in that first function would be the best way to go I think