I hope I am not duplicating an existing issue (searching has revealed none) so appologies if I am.

If Secondary links are set up to come from the same menu as primary links then the sub-menu/secondary links are not displayed in the case that the primary link path is <front>.

I have tried this in 4.7 and both the 5.x betas with the same results so it seems to have been a bug for a while.

There have been various discussions on the subject (such as http://drupal.org/node/70146) but as far as I can tell no fix has been attempted.

To my mind this problem seriously hampers the usefulness of the dynamic secondary link functionality so hopefully it can be fixed for 5.x.

Comments

nasi’s picture

Version: 5.0-beta2 » 5.1

This bug is still present in the most recent 5.1 release.

neochief’s picture

Version: 5.1 » 5.7
Status: Active » Reviewed & tested by the community
StatusFileSize
new552 bytes

Hello

I've fixed this bug and attached the patch.

(it's my first patch for Drupal, I've tried hard to do it right way ;)

David_Rothstein’s picture

Version: 5.7 » 5.x-dev
Status: Reviewed & tested by the community » Needs review
StatusFileSize
new770 bytes

Nice work! Looks like you've definitely found the source of the bug and fixed it.

A couple things to note:

1. I'm attaching a slightly revised version of your patch with code style changes (see http://drupal.org/node/318) and also using drupal_is_front_page(), which I think is the best way to check if we're currently on the front page of the site.

2. Usually when you submit a patch you should set it to "code needs review". Then if someone else comes along and tests it, they can set it to "ready to be committed". For example, if you test the patch I'm submitting here, you can set it to "ready to be committed".

Nice job, though, and welcome to the community of people who have submitted patches ;)

David_Rothstein’s picture

By the way, I tested Drupal 6 and with the new menu system this bug no longer seems to be present. So it really is ready to fix in 5.x only now.

sinasalek’s picture

Status: Needs review » Reviewed & tested by the community

Nice patch thanks, tested with drupal 5.7 and works as expected

drumm’s picture

Status: Reviewed & tested by the community » Fixed

Committed to 5.x.

Anonymous’s picture

Status: Fixed » Closed (fixed)

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