Closed (outdated)
Project:
DHTML Menu
Version:
6.x-3.5
Component:
Javascript code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
2 Jul 2009 at 14:21 UTC
Updated:
30 Sep 2019 at 13:25 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
bwinett commentedHas anyone figured out how to fix this?
Comment #2
anrikun commentedYou may try http://drupal.org/project/menu_firstchild
It supports DHTML Menu.
Comment #3
raphaelhuefner commentedI worked on this issue because I had to "scratch my employer's itch" ...
To get rid of the
warning: Invalid argument supplied for foreach() in /home/raphael/projects/vtrunk/sites/all/modules/dhtml_menu/dhtml_menu.module on line 175., the "Expanded"-checkbox of all the "nolink"-items should get switched on. But that is not the whole story ... I needed to make a patch, also, which I'm going to describe next:The JavaScript in dhtml_menu.js tries to attach
toggleMenu()(the collapse/expand-behavior) on the appropriate<a>-tag, but with the "nolink"-item of http://drupal.org/project/special_menu_items it should better do this to a<span class="nolink">-tag. So I augmented the jQuery-Selector from being'a:first'to'a:first, span.nolink:first', but in "nolink"-items, this will still search for an<a>-tag, even among deeper descendants, which might be a leaf menu item, for instance, which should not toggle anything.So I additionally changed the
.find(selector)-call into a.children().filter(selector)chain, in order to assure only direct descendant<a>-tags get thetoggleMenu()-behavior.Furthermore I added a means of the two modules communicating about the actual HTML-code being used to mark "nolink"-items, simply by querying
Drupal.settings.specialMenuItems.nolinkSelectoron this end. As long as this variable is not set, there is a fallback, of course. I still have to file an issue with http://drupal.org/project/special_menu_items to get this variable set in the first place. I will crosslink the two issues as soon as I know the other issue number.By the way, #585984: Menu item with 'no' path might be a duplicate of this issue here.
Comment #4
raphaelhuefner commentedThe corresponding issue over at http://drupal.org/project/special_menu_items is #661166: Make inter-operable with dhtml_menu , which will set the JavaScript variable
Drupal.settings.specialMenuItems.nolinkSelector.Comment #5
srobert72 commentedSame conflict with Admin module. DHTML Menu + Admin modules give me this error :
I use :
dhtml_menu 6.x-3.x-dev (2009-Dec-07)
admin 6.x-2.0-beta2 (2010-Feb-24)
Comment #6
adrianmak commented#2: the menu_firstchild module link the parent link to it's first menu child that is not my desire. On the other hand, special menu items is what I want to , ie no link on the parent item.
Comment #7
anrikun commented#6: But if you use menu_firstchild with dhtml_menu, you might get what you need as the link on the parent item will only expand/collapse children.
Comment #8
adrianmak commented#7: I tried menu_firstchild with dhtml module, I added < firstchild > on parent menu item path , but it still link to first child path while clicking the parent menu item
Comment #9
anrikun commentedYes the link is still here but dhtml_menu should override it with the expand/collapse effect.
Comment #10
adrianmak commentedYes but the parent link still clickable even though the child items are expanded.
Comment #11
AdrianB commentedSubscribing.
Comment #12
manuel.adanIn the meantime, special menu items v. 6.x-1.4 runs ok with dhtml_menu 6.x-3.5
Comment #13
jasondecamp commentedTried Patch from #3 (raphaelhuefner). Still get annoying error when links are not set to be expanded by default. Would be nice to fix this. Other than that, the patch appears to work as long as you apply the patches to both DHTML and Special_Menu_Items.
Thanks Raphael
Comment #14
geerlingguy commentedSubscribe.
Comment #15
beckyjohnson commentedThis combo does not work for me. Special menu items 6.x-1.4 works with DHTML but it breaks Menu Block 6.x-2.3. Items that have special menu attributes won't expand.
Comment #16
beckyjohnson commentedWhat version of DHTML did you test this patch on? I got the special menu items patch on ok but even with this patch as well, DHTML menu is still broken for me.
Comment #17
cburschkaA few changes to 6.x-3.x-dev were committed since the 3.5 release, notably including some sanity checks in the menu traversal (and compatibility with devel_themer, but that was such a specific fix it shouldn't have affected anything else). For example, the error message mentioned in #5 should no longer occur.
It'd be good to know if the conflicts remain in the 6.x-3.x-dev version.
Comment #18
Nico7 commentedHi,
It's 2012 and the issue is still not resolved.
When the parent item is a nolink item, it is being shown as a link. If I click on the link, an error message occurs.
There shouldn't be a link at all.
Has anyone solved this?
Comment #19
El Bandito commentedor found a workaround ?
Cheers
Comment #20
Nico7 commentedHi El Bandito,
I solved the problem by going to the special menu items settings and replacing span with a href="#" (you have to put < and > around).
Now, special menu items works fine with DHTML module. I hope this works for you too.
Regards, Nico
Comment #21
El Bandito commentedNico
I tried your suggestion, but my problem is that as soon as I enable this module my DHTML menus stop behaving properly - specifically clicking on a parent menu item causes several menus to expand, but not the one I actually clicked on. Very strange.
Hmmmmmn.
El B
Comment #22
vuilI closed the issue as Closed (outdated) because it is for unsupported 6.x version of Drupal.
Thank you for the contribution!