To duplicate this issue:
- Create two hierarchical menus
- Set one as the Menu Trails-enabled menu and configure it based on some criteria (in my case I was using a category)
- Set up a page in the 2nd or 3rd level of the non-Menu Trails menu, you should see its breadcrumb work correctly at this point
- Enable "set breadcrumbs" in Menu Trails, and your breadcrumb on the above page will be broken (you'll just get "Home")
This is due to how enabling "set breadcrumbs" results in a call of menutrails_get_breadcrumbs(), which simply goes ahead and overwrites the existing breadcrumb based on the enabled menu and the current page (by relying on menu_tree_page_data()) no matter what, even if the page in question belonged to another menu.
I think it would make much more sense to only have this override happen if the node is present in the enabled menu. Right now I've settled for a somewhat rudimentary solution that checks if the returned breadcrumb contains just "Home" and doesn't replace the existing value. It's hardly optimal and a better solution would be to improve menutrails_get_breadcrumbs() itself, but it had to do for now.
| Comment | File | Size | Author |
|---|---|---|---|
| #5 | menutrails-460476-5.patch | 796 bytes | peximo |
| menutrails_breadcrumb.patch | 731 bytes | tirdadc |
Comments
Comment #1
tirdadc commentedUgh, messed up the status.
Comment #2
les limActually, the status you're looking for is "needs review".
Comment #3
les limI can confirm the problem you describe, and the patch does fix it. I'm a little concerned about the second part of the conditional where you're doing string comparisons on the formatted "Home" link. It's pretty inflexible, and I'm not sure I can think of a situation where I'd necessarily want that check to be made.
Comment #4
justin2pin commentedis there a reason we can't just remove the following (from line 136):
Why would we want to do any breadcrumbing if menutrails isn't controlling the menu item?
Comment #5
peximo commentedInstead of do a string comparisons we can verify that the node on wich we set the breadcrumb is of a type enabled for menu trials (menutrails_node_types).
Comment #6
hefox commentedI was having the same issue (twas conflict with menu breadcrumbs, overriding those).
It seems whatever way, this check should probably be done (ie don't set breadcrumb if it's count is below 2 (which from what I can tell all $crumbs will have home, since it only adds, not subtracts; ie the string comparison is likely not needed.).
Comment #7
imrook commented+1 for this functionality. I think I like the patch in #5 the best so far.
Comment #8
sunThanks for taking the time to report this issue.
However, this should actually be handled by menutrails_get_node_location(), which makes it a duplicate of #702350: Page title is always included in the breadcrumb for node not processed by menutrails.
You can follow up on that issue to track its status instead. If any information from this issue is missing in the other issue, please make sure you provide it over there.