This bug is two releases old, being reported first in 4.x here #7664: Menu item does not expand on selection (navigation.module) and 5.x here #251655: Menu item does not expand on selection

Both previous issues have been marked as closed without a fix being provided.

I'm opening this issue to confirm it is still present in 6.x

Here is the set-up that causes the bug:

For the following menu structure:

-- Co-curricular (menu item)
---- Music (page)
------ Music Staff (page)
------ Music Groups (page)
------ Instrumental Lessons (page)

Where "Music staff", "Music Groups" and "Instrumental Lessons" are pages and all have "Music" as their parent menu item.

Where "Music" is a page and has "Co-curricular" as its parent menu item.

Where "Co-curricular" is a menu item in the "Navigation" menu with it's path set to "Music".

The problem is that when Co-curricular or Music are selected the children of Music do not expand.

I spent some time looking at the core code for Drupal 6.13 and it seems to me that the problem is lurking in

includes/menu.inc

within

line 1066: function _menu_tree_data($result, $parents, $depth, $previous_element = '')

It seems that in some instances this function is incorrectly determining whether there are children below the current node.

I'm still getting my head around the function and will post here if I make any more progress. But it could be a good starting point for someone else.

Note: when testing this function I commented out the code for loading the menu from the cache, it makes it easier to test knowing you aren't looking at a cached version of the menu.

Comments

asb’s picture

Coming from #251655: Menu item does not expand on selection, subscribing.

[+Edit]: Additionally we discovered today a duplicate menu item (the same page appeared twice at different positions in a menu)

aryanto’s picture

me too :)

danny_joris’s picture

Same issue here with D6.

I have a website with 2 languages. One is French, second is Dutch. I have a parent menu item that shows the child item in the menu when you click on it. This works for the French version, but not for the Dutch. The menu settings are exactly the same. The only difference I can see is that French is the website's default language. French does not have a path prefix, while Dutch has.

--Edit: Dutch version doesn't even work when I check it as 'expanded'.

silviucostiniuc’s picture

The same problem. I've created a menu to show it in different blocks. I cannot expand to view the children of a link. It doesn't happen in all cases. That's very strange...

gbcomputer’s picture

I assume the problem is resolved if you use set the alias as usual on the page, but when you set the path for the menu, you must use the internal id such as:

node/3

and then the menus expand.
But what to do when you need to apply one page to duplicate menus in hierarchy. EEEEEEEEEEk.
it loses its postion.

anyone?

terryallan’s picture

I have experienced problems like these for about a year now on some of my v5 sites. I have just always had to adapt my site designs to overcome the problem. Not what I wanted to do but the problem seems to be ongoing. As with gbcomputer above I ask can anyone offer a solution?

balsama’s picture

It seems that you need to

1) create the page and set the menu item on creation making sure to set the menu parent one level above where you eventually want it
2) create the parent menu item in the admin->site building->menus section and point it to the page you just created
3) Move the menu item created at page creation under the new parent

lastnico’s picture

Are there any news about this bug?

dirksonii’s picture

Priority: Normal » Critical

Although I don't believe this officially merits critical status, this bug has been open, active, and unassigned for six YEARS. I'm bumping this up to critical in the vain hope that someone with some experience will take a look at the damn thing.

tobyontour’s picture

I had this problem and chased it around for a while (and swore a lot) and finally managed to fix it for me. The problem was the theme.

It seems that this call:
theme('links', $primary_links, array('class' => 'links', 'id' => 'navlist')

to theme the primary links (and the similar one to do the same for secondary links) was no expanding links. (see page.tpl.php).

To see if this is what is causing you trouble then:

  1. Go to Admin > Build > Block
  2. Move the Primary Links (or whatever menu it is) to another block (content would be a good one)
  3. Save blocks
  4. See if the problem remains when the menu is in the content block

I've rolled my own theme but started by using the standard template for a page and therefore I picked up this piece of code without thinking about it. I've now changed my template to just have a 'navigation' block where I can place menus to my hearts content.

Hope that helps someone.

How to solve the problem involves either editting the page.tpl.php file or creating new menus (not primary or secondary links menus) and moving them to the block area you want them in. The latter depends on the theme designer having thought far enough ahead to let you have an area in which you can do that.

dpearcefl’s picture

Category: bug » support
Priority: Critical » Normal
Status: Active » Postponed (maintainer needs more info)

Do you still need help?

dpearcefl’s picture

Priority: Normal » Major
Status: Postponed (maintainer needs more info) » Active
kars-t’s picture

Priority: Major » Normal
Status: Active » Fixed

Hi

I am closing this issue to clean up the issue queue. Feel free to reopen the issue if there is new information and the problem still resides. If not please make sure you close your issues that you don't need any more.

Maybe you can get support from the local user group. Please take a look at this list at groups.drupal.org.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

awm’s picture

Version: 6.13 » 6.26
Status: Closed (fixed) » Active

This is still an issue in drupal 6.
I have a menu block that is in the following hirarchy
-parent (points to node/2)
--child 1 (points to node/3)
--child 2 (points to node/4)

When I go to parent the menu does not expand nor assign active trail to parent. If I check the expanded box, then it is always expanded.

Now What puzzels me is that if I create 3 views, where each view is a view of a single node and assign appropriate paths
-parent (points to viewofnode2)
--child 1 (points to viewofnode2/3)
--child 2 (points to viewofnode2/4)

The in I click on parent and goto viewofnode2 the menu expands and assigns appropriate classes.
I do not know what is going on and therefore I am reopening the issue.

Status: Active » Closed (outdated)

Automatically closed because Drupal 6 is no longer supported. If the issue verifiably applies to later versions, please reopen with details and update the version.