If you create a tree structure of MENU_NORMAL_ITEMs via hook_menu only the parent element (root element) will be shown. I attached a patch to solve this issue in include/menu.inc. Use this code to reproduce the issue:
function YOUR_MODULE_menu($may_cache) {
$items = array();
if ($may_cache) {
}
else {
$items[] = array(
'path' => 'parent',
'title' => 'Parent',
'access' => TRUE,
'type' => MENU_NORMAL_ITEM | MENU_EXPANDED,
);
$items[] = array(
'path' => 'parent/child',
'title' => 'Child',
'access' => TRUE,
'type' => MENU_NORMAL_ITEM,
);
}
return $items;
}
| Comment | File | Size | Author |
|---|---|---|---|
| menu.inc_.patch | 683 bytes | mkalkbrenner |
Comments
Comment #1
mkalkbrennerComment #2
mkalkbrennerComment #3
mkalkbrennerComment #4
drummThis seems okay, but definitely needs review.
Comment #5
mkalkbrennerOur drupal 5 based sites run fine with this patch since almost 2 years ;-)
Comment #6
tr commentedDrupal 5.x is no longer supported. Drupal 6.x has an entirely new menu system, so the patch posted here no longer has any relevance. I tested to see if this bug was present in the new Drupal 6 menu system, using the menu_example module from http://drupal.org/project/examples . I cannot reproduce the behavior described by the original poster.
I'm marking this issue as closed/won't fix - if a similar problem occurs a new issue should be opened.