Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
There is a possibility that Menu Breadcrumb sets the active menu to Administration Menu's menu, which can lead to undesirable results.
Please see http://drupal.org/node/279767 for the issue and the comments starting from http://drupal.org/node/279767#comment-983981 for a quickfix and some discussion.
Comment | File | Size | Author |
---|---|---|---|
#72 | 303247-menu_breadcrumb-setting_active_menu_to_undesirable_items.patch | 2.7 KB | xurizaemon |
#60 | menu_breadcrumb-6.x-1.x-dev-303247_58.tgz | 2.33 KB | xurizaemon |
#58 | menu_breadcrumb.patch | 2.28 KB | jweowu |
#27 | menu_breadcrumb.patch | 1.93 KB | webrascal |
#19 | menu_breadcrumb-HEAD.undesirable-menus.patch | 1.87 KB | sun |
Comments
Comment #1
Proct0t CreditAttribution: Proct0t commentedChanging the title to be a little more general and descriptive.... mention of Administration Menu above is only an example of the issue.
Comment #2
smk-ka CreditAttribution: smk-ka commentedThis is how I think it could work: iterate through matching menu items (which means quite some overhead without menu weights) and use the first item with positive access permissions. Patch is completely untested.
Comment #3
pwolanin CreditAttribution: pwolanin commentedI agree that the sloppy select is the problem, but this module could run into the same problem with book module, or any other module using the menu_links table. Important note: LINK PATHS ARE NOT UNIQUE.
If you want the link saved by the system module for this path (which should be unique), change the query to specify that:
Also note, you probably want hidden = 0, since that column can have values, 1, 0, or -1.
Note- this looks like the same problem code that appears in the Local Menu module : http://drupal.org/node/296534#comment-998251
An alternative/additioanl approach would be to make sure you only set as the active menu one of the menus managed by menu module. They are listed in table {menu_custom}.
Comment #4
Proct0t CreditAttribution: Proct0t commentedI've finally learnt how to diff and patch and so tested #2, but unfortunately it hasn't helped. The access problem is indeed a problem but I don't believe it to be the reason behind the current issue: admin_menu menu is still set active when a user with the right permissions logs in, which is what happens in my case....
Comment #5
bengtan CreditAttribution: bengtan commentedHi,
@sun, pwolanin: Have we actually taken the time to consider what should be the correct behaviour before jumping into implementing code?
If a link (ie. node/add/story) appears in two menus (ie. navigation and admin_menu), what should the breadcrumb be?
Should it be // home // create content ?
Or should it be // home // content management // create content ?
Or should it just randomly pick between the two? :)
It's ambiguous, and I don't think menu_breadcrumb nor necessarily the Drupal menu system was designed for this ... which would mean something is fundamentally broken.
Comment #6
Proct0t CreditAttribution: Proct0t commentedaye, i've been saying that for a bit, so: http://drupal.org/node/279767#comment-1013732
Comment #7
gdevlugt CreditAttribution: gdevlugt commentedFirst of all, sorry for my late reply. I've been occupied with my work lately and had/have little spare time to check the issues queue.
@smk-ka and @Proct0t:
I tried the fix mentioned by smk-ka, and think it's good to check the access attribute since it only gets set and not used by the breadcrumb menu. However, there are cases like Proct0t correctly stated where the user has access but the 'bug' still occurs. For example, using the code with the patch with the Administration Menu module, going to the user login page still gives troubles.
@pwolanin, @bengtan and @Proct0t:
Indeed link paths are not unique and ambiguous. Unfortunately I would say by it's nature it's impossible to tell to which menu a menu item belongs (without proper context or some convention).
To partially solve these problems, I would propose the following for the Menu Breadcrumb module :
These solutions might not be perfect, but imho it's better to have a workable fix than a bug for months until a better solution is present.
I didn't have too much time to delve into the problem so maybe the proposed solutions may not be right or I might be missing something. So any comments are more than welcome.
Comment #8
TravisCarden CreditAttribution: TravisCarden commentedI think it would be smart to add the ability to exclude certain menus from use. The Navigation (Administer) menu, specifically, is such a common and obvious case that you might even like to disable it by default. Good suggestions!
Comment #9
scottrigbyHi - has there been any further development on this issue? Thanks :) Scott
Comment #10
adaven CreditAttribution: adaven commentedI've created a patch that lets you ignore certain menus. I can't login to the CVS server from the office, so the diff was done using Perforce. If should still be valid(ish).
Comment #11
adaven CreditAttribution: adaven commentedoops! There was a typo in the patch.
Comment #12
JohnAlbin@gdevlugt I like the feature set you mentioned. Limiting Factor's patch only tackles #2, but it works great!
I marked admin_menu, devel, and navigation as “Ignore menus” and that lets Drupal core handle the breadcrumbs for the navigation menu (so no more favicon in the navigation breadcrumb :-p) and /user breadcrumbs works now too. woo-hoo!
I re-rolled the patch in CVS, but made no changes otherwise.
I'm marking this RTBC since it seems to do #2 well. We still need code for the #1 and #3 bits.
Comment #13
JohnAlbinBlargh. I spoke too soon. The previous patch (in #11 and #12) doesn't work since there is a weirdness with in_array() and zero values. See http://www.php.net/manual/en/function.in-array.php#86695
This patch uses in_array() in STRICT mode and works well. Please review.
Comment #14
pedrofaria CreditAttribution: pedrofaria commentedTHANKS!
work perfect for me!
Comment #15
adaven CreditAttribution: adaven commentedGood catch, wrapping the variable_get('menu_breadcrumb_ignored_menus', array()) in an array_filter will also work, since it removes NULL values from the array.
Comment #16
sunTrivialized parts of this patch.
However, I'm a bit afraid that users need to know that they have to change menu breadcrumb's settings in order to fix this annoying issue (when admin menu is installed).
Comment #17
JohnAlbinGood point, Daniel.
I’m just thinking out loud here…
Maybe, by default, we're going to have to hard-code admin_menu into the exclude list. And/or have some way for other modules to automatically add their menus into the exclude list.
Maybe the admin_menu.module could form_alter() to check the "admin_menu" box in the "Ignored menus" list on admin/settings/menu_breadcrumb?
Comment #18
adaven CreditAttribution: adaven commentedI like the idea of having admin_menu disabled by default.
If you used form_alter it wouldn't take effect until the first time you administered menu_breadbrumb. If you really wanted to do it you'd need to define a hook that let all modules declare if they would like to their to be part of menu_breadcrumb. Personally though I don't think this would make much sense though.
Why not just drop a drupal_set_message into the hook_install prompting the user to go to admin/settings/menu_breadcrumb and choose their menus there?
Comment #19
sunWell, let's do it then.
Comment #20
Renee S CreditAttribution: Renee S commentedWorked for me!
Comment #21
scottrigbyHmm, I could be missing something - but after applying the patch (updated to HEAD in order to do so), I now don't see Menu Breadcrumbs working at all.
The site I'm testing this on still has to be upgraded from D6.6 to 6.8. Could this be part of the problem? Otherwise I'm not sure what could be... I ran the updates, and flushed caches.
Does this make any sense at all? Thanks for any clarification
(I could optionally apply the patch to 6.x-1.1 if it would still apply... I'm just thinking using HEAD on a production site may not be a good idea anyway?)
Comment #22
scottrigbyFollow-up: I double-checked on a clean install of D6-8 and alternately tried patching against Menu Breadcrumb 6--1-1. The 'menu breadcrumb' functionality doesn't seem to be working at all with the patch applied. I tried with and without excluding the admin_menu in the patched MB configurations. As soon as I reverse the patch, menu breadcrumbs works again (of course in that case the issue is still there, conflicting with admin_menu).
Please let me know if you have it working, because it's possible I may be missing a step somewhere? Or if there's anything else I can do to help troubleshoot?
Comment #23
japanitrat CreditAttribution: japanitrat commentedhum, wow, thats a lot of patches... as said before, the whole admin-menu (not the module, i mean the core-menu) is subject to exclude. For instance: i have garland as administration theme and a self-made as normal theme. when using menu_breadcrumb without excluding paths starting with "admin/*", i get garland theme when i try to configure blocks for the other theme.
furthermore, "user/*" becomes ugly, too. I suggest there should be something like block-visibility (having the opportunity to exclude/include certain paths).
Comment #24
svdoord CreditAttribution: svdoord commentedFYI: The patch in #19 seems to do the trick for me. Is this going to be in the next version any time soon?
Thanks!
Comment #25
FunkMonkey CreditAttribution: FunkMonkey commented@scottrigby: The patch in #19 worked well for me when run against 6.x-1.x-dev (with a date of 2009-Feb-10). I did not try it against theofficial release.
Thanks for the work on this everyone.
Comment #26
anantagati CreditAttribution: anantagati commentedPatch from #19 works perfectly for me on official realease 6.x-1.1.
Thank you for patch.
Comment #27
webrascal CreditAttribution: webrascal commentedI'm a bit stunned that it's working for some people, and not for others.
Having tracked down the bug, it shouldn't be working for anyone!
We had:
which was removed through the patch. But the patch also uses the $use_menu variable (which was removed) in the added code here:
So, of course, the easy fix:
Works for me :)
I've included this change in the attached patch, if you'd like to confirm.
Cheers!
Comment #28
svdoord CreditAttribution: svdoord commented@webrascal: I can confirm that your patch also does the trick for me, just like the old one did. I didn't look into what's going on and why the first patch worked even though you say it shouldn't, so I don't have an opinion about that aspect at this point.
Comment #29
webrascal CreditAttribution: webrascal commentedThanks svdoord for the check.
I've changed the status to reviewed pending further reviews to make sure it's ok.
I'll pop back in a couple of weeks and close it if all seems well by then.
Comment #30
jwoolson CreditAttribution: jwoolson commentedThank you, svdoord, for the patch.
This evening, I ran into the same conflict between admin_menu and menu_breadcrumbs. Searched for a few minutes to find this issue queue.
I curled the patch, looked up how to patch a file in the fine handbooks that Drupal offers, and made my first module patch. Works perfectly. The extra menu exclusion options are helpful.
Drupal's strength is this engaged community.
I'm collecting all modules into a common code base to assemble a robust CMS for higher education use at:
http://web.fredonia.edu/d6
Thank you, all.
Comment #31
svdoord CreditAttribution: svdoord commentedHi jwoolson,
I'm glad it worked for you. I cannot take credit for this patch though, this one was made by others :-)
By the way: is there any word on when this will end up in a release?
Thanks!
Comment #32
q0rban CreditAttribution: q0rban commentedsubscribe
Comment #33
toomanypets CreditAttribution: toomanypets commentedThe patch posted with #27 worked perfectly for me. Thanks much for the fix!
Comment #34
cbow CreditAttribution: cbow commented+1 patch #27, it works for me.
Comment #35
tirdadc CreditAttribution: tirdadc commentedI can also vouch for patch #27, it would be nice if it made it into the next version (if there ever is one).
Comment #36
xurizaemon+1 for #27 which appears to have fixed the issue for us also
@webrascal, are there other issues open which are blocking release of an updated menu_breadcrumb with this fix?
Comment #37
joep.hendrix CreditAttribution: joep.hendrix commented+1 for #27 seems to work just fine.
Comment #38
AaronChristian CreditAttribution: AaronChristian commentedYes this works as well for me! Thanks for the all the patch work everyone!
Comment #39
Anonymous (not verified) CreditAttribution: Anonymous commentedHi all, I encountered the issue per node/279767.
I am no techie but the menu breadcrumb that I hv downloaded diff looks like it has been patched #27.
When I uninstall menu breadcrumb the "error/undesirable" msg dissapears.
Comment #40
Les Limmarked #417052: issue on /user page. related to admin_menu as a duplicate of this issue.
Comment #41
AdrianB CreditAttribution: AdrianB commentedI applied the patch i #27 and it works just fine in my so far limited testing. Maybe it's time to commit this?
Comment #42
q0rban CreditAttribution: q0rban commentedI doubt the maintainer needs any more people to weigh in on their approval of this patch. ;) At this point all we can do is either wait until gdevlugt has time to commit this, or until someone requests to co-maintain this module to take some of the load off for him.
Comment #43
grendzy CreditAttribution: grendzy commented#27 works for me.
Comment #44
Puppetmast0r CreditAttribution: Puppetmast0r commentedI know very little php or mysql, and my question is this:If I wanted to set the menu I want the breadcrumbs to use by hand, how do I do that?I have no ethical problems with hand-hacking a module if someone could tell me where to put the name of the menu in men_breadcrumbs.module.If it matters, the menu I want the breadcrumbs to use is Primary Menu.For the record: I'm also using the Local Menu module, I hope that doesn't make things messier.EDIT: I found http://drupal.org/node/364363
It still doesn't work, but that's probably a Local Menu issue then.
EDIT: not Local Menu, not Menu block, I'm at a loss.
My menu has a basic structure
Home
>Vocab
>>Term
>>>Nodetitles
Front page: I get the word "content" (not a link).
Maybe this used to be a Vocab name, I'm not sure.Vocab page: it works Home > Vocab, last one unlinked as it should be.
Term page I get "Home" (linked) instead of Home > Vocab > Term
Node page: it works Home > Vocabulary > Term > Nodetitle last one unlinked as it should be.
So right now I get a 50% hit/miss rate :(
Comment #45
Bartezz CreditAttribution: Bartezz commentedThanx webrascal!
Comment #46
webrascal CreditAttribution: webrascal commentedSorry about the delay guys, been a bit tied up with various projects. Glad that it works for those who posted.
I'll look into getting this rolled up as well as other issues as requested as soon as I can.
Comment #47
m.rademacher CreditAttribution: m.rademacher commentedPatch from #27 worked for me.
Comment #48
Anonymous (not verified) CreditAttribution: Anonymous commentedsubscribing
Comment #49
fenstrat#27 worked for me.
Comment #50
teecee CreditAttribution: teecee commented#27 working well at my site, thanks!
Comment #51
xurizaemonwas surprised today to find this issue still open (and still collecting "+1 patch works" comments like a very sticky thing)
@webrascal, in #46 you sound like you're planning to roll a release of this, but I can't see that you're a maintainer of this module (yet!)
will the current maintainer be giving you access to release an update with this fix applied?
i'm wondering how i can best help get this one sorted, eg by offering to co-maintain or by working on other issues which might be blocking the release of a fix for this issue.
Comment #52
jweowu CreditAttribution: jweowu commentedwrt the patch in #27.
I think that $form['menu_breadbrumb_ignored_menus'] in menu_breadcrumb_admin_settings_form() should filter out some options.
'admin_menu' and 'devel' are always ignored by menu_breadcrumb_init(), so they should be definitely removed from the list.
And as 'navigation' is the Drupal 6 default, it doesn't seem valid to offer to exclude those menu items, because if menu_breadcrumb_init() is unable to find an alternative, the navigation menu will be used.(edit: Ignore that. If a menu item appears both in Navigation and another menu as well, it's still useful to be able to exclude Navigation from the search list, to ensure the item in the other menu is used.)So I think the $options array should perhaps be changed from drupal_map_assoc(menu_get_names()) to drupal_map_assoc(array_diff(menu_get_names(), array('admin_menu', 'devel')))
Comment #53
joachim CreditAttribution: joachim commentedPatch works for me too.
(Though I wasn't able to reproduce on a test site...)
Comment #54
dariogcode CreditAttribution: dariogcode commentedI have a problem with this module in a multilingual site, because two primary menus (for english and japanese) targeting the same content, then, the breadcumb always show a breadcumbs in japanese. I make a little changed in #27 code for fix it. I thinks it is a hack at the moment.
This code only break iteration if the link was found in primary links for the current language, otherwise find the first link occurrence in menu_links table.
My apologize for my english.
Comment #55
keesje CreditAttribution: keesje commented+1 for patch in #27, works for me.
-------------------
Armband kopen
Comment #56
2ndmile CreditAttribution: 2ndmile commentedAnother +1 for #27 and to say thanks! I love Open Source!
Comment #57
anantagati CreditAttribution: anantagati commentedIt seems that maintainer of this module is not anymore active in the community. If there is somebody who is ready to take care maybe he can contact current maintainer or post issue to become maintainer.
Comment #58
jweowu CreditAttribution: jweowu commented#27 is actually slightly deficient, I've concluded.
The problem with having a black-list of menus to ignore is that new menus can be generated dynamically.
In particular, the book module creates a menu for every single book, to store its page hierarchy.
If you didn't want that to affect menu_breadcrumb, you would need to edit the menu_breadcrumb settings every time you created a book.
Here's a new patch (against 6.x-1.x-dev, 2009-Feb-11) which enable you to choose whether the selected list of menus should act as a black list or a white list.
Defaults match the default behaviour of #27, however I've changed the 'ignore list' persistent variable name, so you'll want to reconfigure the module if you had already customised the settings with an ignore list.
To ensure that menu_breadcrumb always tries to use one specific menu, just select that menu (only) and choose the white-list option.
Comment #59
xurizaemon@anantagati - I've opened an issue at http://drupal.org/node/539240 regarding this module's potentially abandoned status.
I'm sure we'd all welcome the return of the module maintainer, but failing that anyone who is keen to maintain or co-maintain this module is welcome to throw their hat in the ring via that issue.
Comment #60
xurizaemonAttaching pre-rolled version of version patched with jweowu's patch from #58 in the hope that it will encourage others to test until we have a module maintainer.
Comment #61
Les LimComment #62
joelstein CreditAttribution: joelstein commentedPatch #58 works for me.
Comment #63
emptyvoid CreditAttribution: emptyvoid commentedSadly with:
Modules
administration menu 6.x-1.5
menu attributes 6.x-1.4
devel 6.x-1.16
menu breadcrumb 6.x-1.x-dev patch
Going to add user displays a funny breadcrumb..
Home › 1 / 1 Current anonymous / authenticated users › 1 / 1 <img src="/sites/all/modules/admin_menu/images/icon_users.png" width="16" height="15" alt="Current anonymous / authenticated users" title="Current anonymous / authenticated users" />
Can anyone else confirm this?
As the thread discusses I have the patched built and have both admin_menu and devel set in the black list.
thoughts?
Comment #64
jweowu CreditAttribution: jweowu commentedHi emptyvoid,
I set up a new Drupal 6.13 site (default Garland theme) with the same contrib modules & versions you've listed, and using the copy of menu_breadcrumb which xurizaemon attached in #60. I enabled all of them except for menu attributes at first (in case that was a conflict), and then tried again with menu attributes enabled, but didn't see any issues in either case when visiting admin/user/user/create.
Comment #65
emptyvoid CreditAttribution: emptyvoid commentedPerhaps another module is conflicting with the breadcrumb code I will attempt to apply the patched version of the module again..
When I reverted back to the initial 1.1 release the issue went away.
I will investigate further and post my results should I figure out what is causing the conflict.
Thanks,
Comment #66
willzzz88 CreditAttribution: willzzz88 commentedPatch #58 works great on the final stable 1.1 release. Thanks!
Comment #67
TrinitySEM CreditAttribution: TrinitySEM commented"Patch #58 works great on the final stable 1.1 release."
Same here. Thanks!
Comment #68
pastk CreditAttribution: pastk commented"Patch #58 works great on the final stable 1.1 release."
Same here too. Thanks!
Comment #69
aaron CreditAttribution: aaron commentedThe patch at #58 solves the issue for me as well.
Comment #70
q0rban CreditAttribution: q0rban commentedPlease please please... Let aaron's post be the LAST 'patch works for me' post. The problem isn't that the maintainer needs more +1's for the patch, the problem is that the maintainer is either too busy on other more important projects and will get to it when they can, or that this module is abandoned. I would suggest someone open a new issue to request for CVS access. Until then, please don't post on this thread unless you've found a bug related to the patches above, or are submitting a different patch.
Comment #71
sunI already would have abused my privileges to commit this patch, but I did not do so, because I do not use this module and the proposed code to fix this issue looks a bit strange to me (apart from the coding style issues).
To move on, someone of you (who uses this module) should apply for CVS access to become a co-maintainer (to do this: create an issue in this queue and contact the maintainer in parallel).
Comment #72
xurizaemon@sun, @q0rban, thanks for the input. http://drupal.org/node/539240 is an issue which attempts to follow the instructions at http://drupal.org/node/251466 for obtaining CVS access to an apparently abandoned project. That page says to wait two weeks before moving the issue to the webmasters queue for them to reassign the project, so there are (only) a few days to go.
aaron and xurizaemon (me) are prepared to take on co-maintainership of this module, would be happy to hear from others who are keen (incl. current maintainer of course).
Updated patch - reformatted fields to make UI a bit clearer (I hope), swapped use of ( a && b or c && d ) for more common ( ( a && b ) || ( c && d ) ) to clarify precedence.
Comment #73
mathieu CreditAttribution: mathieu commentedLast patch worksforme. Subscribing...
Comment #74
grendzy CreditAttribution: grendzy commentedRegard the possibility of a new maintainer... I've also opened #560464: Consider merging with menutrails
Thanks!
Comment #75
xurizaemoncommitted in http://drupal.org/cvs?commit=257682
thanks all for your patches and patience! as of today, this module has two new maintainers (aaron and xurizaemon)
Comment #77
xurizaemonjweowu, I am happy enough with the usage of the 6.x-1.x-dev release which contains this fix (or, lack of complaints from the sites using that release!) to push out an official update now. But I see that you've opened #556552: Menu weights, black/white list, and memory of menu selection with some related issues spun off from there.
Are there any issues raised in that queue (with regard to weighting the menus) which would suggest that the blacklist/whitelist feature shouldn't make it into an official release? Happy to hold off if you think a better fix is on the cards.
Comment #78
jweowu CreditAttribution: jweowu commented#595282: Menu weights is a factor, because that changes the structure of the 'menu_breadcrumb_menus' variable.
If you make an official release, we'll need to add a hook_update_N() to convert existing variables to the new format.
If you think the menu weights will take a while to evaluate, then it might be worth releasing what's committed now (which does resolve a notable problem, after all), and writing that update code.
Comment #79
joachim CreditAttribution: joachim commentedAny chance of a release with this fix?
It's been several months since this was committed, yet obviously it's still showing up as a problem when downloading the current release.
Comment #80
jweowu CreditAttribution: jweowu commentedThis patch was committed to -dev, so installing that build is an option.
I can't speak for the maintainers, but as there hasn't been a stable release with this so far, I suspect that it may be passed over in favour of #595282: Menu weights.
The latter is now looking for people to review it, so it might speed things along if people could try that out?
Comment #81
xurizaemonYes, I should have said as much earlier in this thread. I'll be reviewing #595282 in the next day or two, and probably release a stable with that if it's good to go. Testing that patch and posting feedback will help this process, so if you'd like to help get the new release out, please do so!
Comment #82
plasticlax CreditAttribution: plasticlax commentedsubscribe
Comment #83
jweowu CreditAttribution: jweowu commentedWhy would you subscribe to a closed issue that was deprecated in favour of a different (and also closed!) issue?
The fix for this has been committed and is available in the latest -dev build. You would do better to try that, and provide feedback.
Comment #84
pokadan CreditAttribution: pokadan commentedHad the issue and has gone away with latest dev version. Will provide further feedback if anything (bad) arises.
Comment #85
plasticlax CreditAttribution: plasticlax commentedthis issue is now gone with the latest non-dev version. 6x-1.2
Comment #86
xurizaemonThanks plasticlax. This issue was resolved by #595282: Menu weights and that patch was included in 6.x-1.2.
Comment #87
akosipax CreditAttribution: akosipax commentedI didn't see this issue queue before but could this be related to this open issue http://drupal.org/node/1414900
EDIT:
Sorry, but I realized that my breadcrumb problem is caused by conflict with menu trails. Just turned off that module.