Hello.
I've created next menu structure for my primary links:
Contents
-Page1
--Page1-1
-Page2
-Page3
I've disabled "Contents" item, because wanted my primarylinks start from next stage (Page1,Page2...)
When I done this, primery links show me that I expected (Page1,Page2...)
But, secondary links did not work, when you are in Page1 section (but it have to).
I've dugg menu.inc file and found interesting thing: _menu_get_active_trail() and _menu_get_active_trail_in_submenu() are not checking the items on enabled/disabled state. So, I've added this checking and all becomes fine. Also, I tested this patch on my production sites. No one seems crashed :) So, please, review this patch, I hope it would be usefull.
Comments
Comment #1
neochief commentedWith some additional testing, found bug in my patch in several situations. Here is the update.
Comment #2
drummThis patch needs to follow our coding standards at http://drupal.org/coding-standards. Specifically, if blocks always need to use {} and the conditional should not have linebreaks.
Comment #3
neochief commentedI beg your pardon, I didn't found any words about this in coding standarts, but I'll be know it in the future. I've updated the patch, please check it.
Comment #4
neochief commentedComment #5
drummwill always be false since
MENU_VISIBLE_IN_TREE & MENU_MODIFIABLE_BY_ADMINis zero. So, the condition can be simplified toOr, the menu has some other type bit than
MENU_MODIFIABLE_BY_ADMIN. I think this might be true for all items. So I'm either reading this wrong, or this patch doesn't do anything.I am also not sure that changing the menu behavior is appropriate at this point in the 5.x release cycle.
Comment #6
neochief commentedSorry, I not remember the problem exactly, but anyway, it's not big deal already, as it was reported more than year ago :) But anyway, thanks for your reply, Neil.