Timeline for Drupal Coding - Menus - hook_menu is not generating menus
Current License: CC BY-SA 3.0
15 events
when toggle format | what | by | license | comment | |
---|---|---|---|---|---|
Mar 21, 2012 at 19:42 | history | edited | Ashlar | CC BY-SA 3.0 |
Question title does not require editing
|
Mar 17, 2012 at 22:44 | history | edited | avpaderno♦ | CC BY-SA 3.0 |
edited title
|
Mar 14, 2012 at 14:27 | vote | accept | Ashlar | ||
Mar 13, 2012 at 23:50 | history | tweeted | twitter.com/#!/StackDrupal/status/179716194868277248 | ||
Mar 13, 2012 at 23:24 | answer | added | Clive♦ | timeline score: 2 | |
Mar 13, 2012 at 19:42 | comment | added | Ashlar | @Clive Please plug in an answer so I can give you credit. | |
Mar 13, 2012 at 19:40 | comment | added | Ashlar | The 'stuff' menu item is also working, although I had also added some content in the page callback which had been empty before, so that may have changed things. However, while the menu item responds to its path in the URL (stuff/existing), it does not appear in the list of links for the menu in the admin/structure/menus/stuff page. I was under the impression that that is where MENU_NORMAL_ITEMs were supposed to appear. Can you confirm that? | |
Mar 13, 2012 at 19:37 | comment | added | Ashlar | OK, some progress! I added dsm's to both drupal functions and found that the menu item was being included. Curiously, the menu_example menu finally showed up in the navigation menu. I have no Idea why it took so many iterations of toggling the module on and off to finally get it to appear (at least 5 cycles). I parts of drupal code cached so that whatever may have been causing the omission of the menu was not readdressed until I altered the code in the core module? | |
Mar 13, 2012 at 18:37 | history | edited | Ashlar | CC BY-SA 3.0 |
added 22 characters in body
|
Mar 13, 2012 at 18:36 | comment | added | Clive♦ |
Yeah I didn't think that'd fix it but it was worth a shot :) The place to start debugging is in _menu_navigation_links_rebuild() which builds up the menu links...it gets passed the menu router items built up from menu_router_build() (which is where hook_menu() is called from). A bit of temporary debug code in that first function would be the best way to go I think
|
|
Mar 13, 2012 at 18:36 | comment | added | Ashlar | I changed the case without a change in the problem. I have also flushed caches. I sure do love these Drupal engimas!!! :) | |
Mar 13, 2012 at 18:30 | comment | added | Ashlar | I did have return $items but forgot to add it in this text. I'll check on case sensitivity, but that does not explain why the menu_example module is not working now. I had it enabled in the navigation menu when I was preparing to work on this menu, but when I re-enabled it, it no longer shows up. | |
Mar 13, 2012 at 18:24 | comment | added | Clive♦ |
I think the 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't return $items; ...could either of these be the problem?
|
|
Mar 13, 2012 at 18:19 | history | edited | Ashlar | CC BY-SA 3.0 |
added code
|
Mar 13, 2012 at 18:08 | history | asked | Ashlar | CC BY-SA 3.0 |