What are the steps required to reproduce the bug?

1) Create a few menu items in the primary links menu. One of the items is at the highest level (with no parent) and the other are children of the first:

a
--b
--c

2) Set the path of 'a' to be .
3) activate the primary links block (tested in garland with the links block on the right sidebar)

What behavior were you expecting?

On the front page I expect the menu item 'a' to be expanded, showing 'b' and 'c'.

What happened instead?

The menu does not expand.

I can't tell if this is a bug or feature and I can't see any other issue about this. Sorry if I've missed something obvious!

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

theborg’s picture

Status: Active » Postponed (maintainer needs more info)

Can you say which is the path to a?

sym’s picture

Status: Postponed (maintainer needs more info) » Active

Ah, it got filtered out:

2) Set the path of 'a' to be .

should be

2) Set the path of 'a' to be <front>.

So 'a' links to the front page, but after its been clicked (and you are viewing the front page) you cannot see the expanded menu.

Setting back to active, because I've given the more info.

theborg’s picture

I am not able to reproduce it on FF 2.0, linux, neither rc2 or dev.

dvessel’s picture

sym, can you set the menu item to be expanded all the time (by checking off "expanded" for the parent item.)? I can't even get that to work even though I set "source for secondary links" to primary in "admin/build/menu/settings".

sym’s picture

If I set the menu item 'a' to be expanded then it is expanded on all pages as expected.

I have tried changing the secondary links settings too, with no affect.

theborg: have you set up the menu as I did? Did your menu item expand on the home page?

webernet’s picture

Version: 6.0-rc2 » 6.x-dev

Confirmed.

With the following menu structure, the top level link in the primary links menu block doesn't expand on the front page.

<front>
- node/1
- node/2
dvessel’s picture

Okay, confirmed as well.

Another related issue is that if the path set for the parent item is not understood by the menu system, it will never expand. I was trying with an external link.

theborg’s picture

Confirmed for me, I haven't set the correct test menu before.

What I have found is that the function that builds the menu_tree_page_data has this sql:

          $parents = db_fetch_array(db_query("SELECT p1, p2, p3, p4, p5, p6, p7, p8 FROM {menu_links} WHERE menu_name = '%s' AND link_path = '%s'", $menu_name, $item['href']));

And in the case of front this is returning false because href is translated to 'node', so the parents array is empty.

theborg’s picture

Status: Active » Needs work
FileSize
1.35 KB

This patch checks if the current path is front page. Although the case of the external invalid path that dvessel found it has to be handled.

chx’s picture

Status: Needs work » Needs review
FileSize
1.34 KB

The external link needs no resolution, it's external so by definiton it can not match any Drupal path which are root relative.

theborg’s picture

FileSize
1.51 KB

This works for me, just corrected a little typo on chx's patch.

webernet’s picture

Status: Needs review » Reviewed & tested by the community

Tested OK.

sym’s picture

Patch applies and works

Gábor Hojtsy’s picture

Status: Reviewed & tested by the community » Fixed

Well, using db_placeholders() here would probably be overkill (and get to the same effect), so this looks all right. Committed, thanks.

Anonymous’s picture

Status: Fixed » Closed (fixed)

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

designbysoil’s picture

Any solution for Drupal 5.x