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;
}
CommentFileSizeAuthor
menu.inc_.patch683 bytesmkalkbrenner

Comments

mkalkbrenner’s picture

Title: Tree structure fails to build » Menu tree structure fails to build
mkalkbrenner’s picture

Version: 5.3 » 5.x-dev
mkalkbrenner’s picture

Version: 5.x-dev » 5.7
drumm’s picture

This seems okay, but definitely needs review.

mkalkbrenner’s picture

Our drupal 5 based sites run fine with this patch since almost 2 years ;-)

tr’s picture

Status: Needs review » Closed (won't fix)

Drupal 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.