Menu tree structure fails to build

mkalkbrenner - November 7, 2007 - 21:01
Project:Drupal
Version:5.7
Component:menu system
Category:bug report
Priority:normal
Assigned:Unassigned
Status:patch (code needs review)
Description

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:

<?php
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;
}
?>

AttachmentSize
menu.inc_.patch683 bytes

#1

mkalkbrenner - November 28, 2007 - 12:06
Title:Tree structure fails to build» Menu tree structure fails to build

#2

mkalkbrenner - January 1, 2008 - 13:57
Version:5.3» 5.x-dev

#3

mkalkbrenner - June 15, 2008 - 09:10
Version:5.x-dev» 5.7
 
 

Drupal is a registered trademark of Dries Buytaert.