Closed (fixed)
Project:
Menu Trail By Path
Version:
7.x-2.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Reporter:
Created:
17 Nov 2011 at 11:37 UTC
Updated:
1 May 2012 at 04:10 UTC
I have 2 menus in my site :
My node's path are base on taxonomy but the active trail don't work for the 2 menus.
For exemple, my node's path is "/blog/cat-2/node-name".
The main-menu "blog" is active, this is great.
The blog-menu is not active, nor the "All categories" or the "Cat 2".
I check the code & the sql query didn't result correctly.
$results = db_select('menu_links','ml')
->fields('ml',array('menu_name','link_path','link_title','depth'))
->condition('link_path',$parent_candidates_normal_paths,'IN')
->execute();Drupal (but with mysql it's ok) find :
The function menu_tree_set_path($menu_name, $menu_link['link_path']) works with the main-menu, but not for the blog-menu, "All Categories" is not active (but in fact, I need Cat 2 to set active).
I'm using Drupal 7.9 & the last version of this module.
Sorry if not clear, it's hard for me in english.
Comments
Comment #1
SeriousMatters commentedHi Errance,
I think you are seeing the Custom menus never receive an active trail problem in Drupal core.
Try this quick fix module:
custom_menu_active_trail.
Comment #2
SeriousMatters commentedTo make life easier for everyone, I am incorporating mattfarina's fix in Menu Trail by Path.
Pushed to 7.x-2.x-dev branch.
Comment #3
gilles_c commentedDon't change anything for me. :-(
Comment #4
SeriousMatters commentedSeems like mattfarina's fix only take effect when adding or updating menu. Errance, try to edit the custom menu in question and save it to trigger the fix.
Comment #5
gilles_c commentedI edit my custom menu & create a new one but nothing.
If my node's path is "/blog/cat-2/node-name", the bold are active.
If I add the node to the menu :
I also try to remove the main menu but nothing change...
Comment #6
SeriousMatters commentedErrance,
1. Ensure you are using Drupal7.9 +
2. Update Menu Trail By Path to the latest version (beta3 at time of this post).
3. Go to: /admin/structure/menu/manage/blog-menu/edit and click save (to activate the core bug fix)
4. Use Firebug to check for 'active-trail' class on /blog & /blog/cat-2 (not 'active' class)
If you are sure that you have done the steps above but active-trail is still not working properly, can you link me to your site? or provide the steps to reproduce the same issue from a fresh installation of Drupal7.9?
Comment #7
arski commentedHey there,
Don't know if this should go in here, but I have the opposite issue: I also have two menus, the main menu just points to the top level /foo and then an additional menu in a menu block that has /foo/bar etc links.. The second menu works fine, but the main menu doesn't.
Maybe it's relevant, but the 'foo' path in the main menu is defined in a module using hook_menu and it redirects to the first '/foo/bar' link - still, it should work shouldn't it?
Using D7.9, latest rc of your module, and checked steps 2,4 above as well.
Thanks
Comment #8
gilles_c commentedI've just finish my website & put it on the web.
For example :
http://www.sinfulgarden.com/blog/livres
http://www.sinfulgarden.com/blog/livres/art-de-lenluminure-39
On the left menu in the second link, 'Livre' isn't active.
I have a Drupal 7.10 & a Menu Trail 7.x-2.0-rc1
Comment #9
SeriousMatters commentedErrance,
Can you confirm that you have re-saved your custom menu to trigger the fix as per step 3 above ?
Your site looks nice and calm. =)
Comment #10
gilles_c commentedI've done the #6.
I also try with a new menu, but won't work.
I'll try to find time this week to test with all the other modules deactivated.
Thanks for liking my website. :)
Comment #11
SeriousMatters commentedSeems like we have a commit to fix this problem in core. The whole problem may finally be solved in D7.11 . =)
Comment #12
SeriousMatters commented#1439234: Remove workaround for core bug, depend on core 7.12+