Closed (fixed)
Project:
Superfish Dropdown Menu
Version:
7.x-1.8
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
16 Jun 2011 at 16:50 UTC
Updated:
18 Jun 2013 at 13:29 UTC
Jump to comment: Most recent file
Comments
Comment #1
WillHall commentedAre you by chance using nice_menus or some other menu modules?
Comment #2
mac_weber commentedI have superfish module on that menu
Comment #3
WillHall commentedBad behavior in superfish module - overwriting localized_options array.
Try opening superfish.module and change at line 1005
From
$link_options['attributes'] = $menu_item['link']['localized_options']['attributes'];To:
$link_options['attributes'] += $menu_item['link']['localized_options']['attributes'];Let me know if that helps. Btw, it seems all of the menu modules do this and need to be fixed. tsk tsk.
Comment #4
mac_weber commentedI get error 500 if I do this change
Comment #5
mac_weber commentedmore details about the error from apache's error log:
mod_fcgid: stderr: PHP Fatal error: Unsupported operand types in /var/www/drupal-7/sites/all/modules/superfish/superfish.module on line 1005and php version:
Comment #6
WillHall commentedBummer, that was just a cursory glance. I will have to install the module and check it out.
I'll let ya know what the fix is in a few.
Comment #7
mac_weber commentedthanks for helping Will!
Comment #8
WillHall commentedThere was a typo in my original..
Should have been:
$link_options+= $menu_item['link']['localized_options'];However, even that doesn't seem to help.
I am going to move this over to the superfish issue queue - they are going to be more familiar with their module.
In the long run, superfish is simply overriding the items stack. The same issue existed in similar modules like nice_menus, and was solved here: http://drupal.org/files/issues/nice_menus.module_6.patch
Comment #9
mac_weber commentedI tried using my own javascript or Drupal.behavior to "fix" it.
This script searches for links ending with the string
<void>and disable the clicks. I realized that if I click twice it would follow the link. Then I disabled the sf-touchscreen plugin so, this script worked. It is possible also to mark the option to use sf-touchscreen (superfish block options) to be used only on browsers that need it.This is far from the best solution, but made my website usable for now.
Comment #10
WillHall commentedRelated #1126574: Menu firstchild support
Comment #11
omercioglu commentedSub
Comment #12
skolesnyk commentedPlease, fix the issue. It's been bugging me for two weeks as neither Menu First Child or Special Menu Items work on superfish menus
Comment #13
omercioglu commentedChange this line in superfish.module from
$output['content'] .= l($menu_item['link']['title'], $menu_item['link']['link_path'], $link_options);to
$output['content'] .= l($menu_item['link']['title'], $menu_item['link']['href'], $link_options);I don't think this small change needs a seperate patch.
Comment #14
skolesnyk commentedShould this fix work with Special menu items module and its placeholders?
Edit 1: still have "< nolink >" in the menu item link instead of '#'
Edit 2: installed Void Menu, placed '< void1 >' in the link for a menu item. It produces a link like http://www.website.com/%23, instead of just '#'.
Comment #15
omercioglu commentedThis fix is only for d7-Superfish.
From what i can see, "Special menu items" is for d6-only right now, most probably this won't work for it.
This is how it works for me.
1-ReSave the menu/menu items where you would like to have "#".
2-Clear your cache.
Are you using d6 by the way?
Comment #16
skolesnyk commentedI'm using D7 port of Special menu items https://github.com/webflo/special_menu_items
Comment #17
skolesnyk commentedI did put in the menu item, saved it, cleared cache, yet the link is still www.site.com/#
Does combination of the Superfish fix you suggested and Void Menu < void > link works in your case?
Comment #18
omercioglu commentedYes, it's working perfectly. Problem is, "Void menu" modifies the "href" attribute of the menu item, but Superfish uses "link_path" to output the menu items. I'm using it on the university site http://etu.edu.tr where you can see superfish and void menu working together...
Comment #19
omercioglu commentedwww.site.com/# is the expected output, this means it's working correctly :-).
<void1> = #. I did not tested<void>, but you can use void1 anyway.Comment #20
skolesnyk commentedYep, I see it's working on your site. Do you know why in the I have < a href="/uk/%23" > instead of < a href=/uk/# > . Link in FF is display correctly with # .
Comment #21
omercioglu commentedDo you get href="/uk/%23" with "special menu items" or "void menu"?
Comment #22
omercioglu commentedI've found the solution, i had overlooked someting i added sometime ago...
Add this:
under the line:
Comment #23
skolesnyk commentedWell, it's a bit messed in the code.
What I had was
changed to
Works like a charm. Thanks a million, omercioglu! I think you still should release a new version of Superfish, as bug is, thought not major, breaks important functionality.
Edit: < front > doesn't work now! Displayed as is.
Comment #24
flacoman91 commentedthanks skolesnyk and omercioglu
Void Menu and the changes listed works. I was trying to figure this out for a while.
Comment #25
nixar commentedI just created an account to thank you guys for the solution.
Comment #26
geek-merlinfor special_menu_items.module:
i created an issue which might provide a fix - your opinion?
#1221294: option to use <a href="#"> for "nolink" items to not break other modules
Comment #27
stldrupal commentedHere is a hacked up crude javascript that might work. Replace the CLASSFORMENU with the class on the top nav. Try sf-depth-1.
====================
function handleKeyPress(evt) {
if (!evt) evt = window.event;
var el = (evt.srcElement) ? evt.srcElement : (evt.target) ? evt.target : null;
if (el){
var searchclassName = el.className;
var t = searchclassName.search("CLASSFORMENU");
if (t==0){
return false;
}
}
}
document.onclick= handleKeyPress
Comment #28
giorgoskfollowing suggestions in #13 #22 and #23 I created this patch which seem to work
please test and report
Comment #29
giorgoskneeds review
Comment #30
mac_weber commented@maintainers, please do a git push to QA. Thus the patches can be tested there.
@GiorgosK the patch name should be this format:
Comment #31
giorgoskdid not know there is a patch naming proposal thanks
Comment #32
mehrpadin commentedHey there,
Next version coming in the next few days. :)
Giorgos, thanks for your helps!
Comment #33
mac_weber commented@GiorgosK I like this guide Advanced patch contributor guide
Comment #34
mehrpadin commentedFixed as of v1.9-beta3 :) thank you all.
Comment #35
mac_weber commentedis it also fixed for D7? - I did not test it
Comment #36
giorgosk@Mac_Weber
this issue is for drupal 7
Comment #37
jaspher commentedOn my site, this works everywhere BUT the actual menu itself. In admin areas, (List links, etc) and breadcrumbs the links are will point to # and javascript: void(0);. But clicking on links on the menu itself will still bring me to "page not found".
Used 1.8 patched and latest 1.9beta4.
Any suggestions on something I may have missed?
---
EDIT: did not even read the OP carefully. I'll try all the suggestions first and come back...
EDIT 2: This works; sorry.. Mistake on my part!
Comment #39
colle901 commentedAs reported in the edit to #23, links to
<front>are not handled correctly. I am using v1.9-beta4.Comment #40
skolesnyk commented@colle901, I'm using Supervish Version 1.8 with Voidmenu. Void menu items work fine for me. You can can them out here http://expertise.one2action.com/en
If it doesn't work for you, try http://drupal.org/project/menu_firstchild -- a module with similar functionality but more recently updated and more popular.
Comment #41
webatelier commentedSuperfish 1.9 beta 4 with Void Menu worked for me using the
<void1>option in placeholder menu itemsi did NO code changes and no issues with the
<front>so far ...Comment #42
payamspot commentedFinally! :)
Confirming #41 (webatelier)
Installed Superfish 1.9 beta4, now "Menu Firstchild" and "Void Menu" modules work properly. ( links to #)
"Special menu items" still not working properly.
Comment #43
macmaci commentedThis issue queue has been very helpful -- particular for a newbie--however isn't it bad practice to have a menu appear to be a link, by having the "hand" icon appear, then being able to "click" the item and then having it go no where ex. example.com/#? The current solution is greatfully appreciated but will there be a better one in the future. Something similar to the way currently works?
Thanks!
Comment #44
mehrpadin commentedHey there,
Sorry for the late reply, issue is closed and didn't appear in the queue. There is a solution: http://drupal.org/project/special_menu_items
Comment #45
catchmagu commentedthanks Mac_Weber for your patch...
Comment #46
vvs commentedand
https://drupal.org/node/1221294#comment-6450416