Closed (fixed)
Project:
Nice Menus
Version:
7.x-2.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
12 Jul 2011 at 14:23 UTC
Updated:
4 Feb 2014 at 22:44 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
universalhandle commentedI'm not sure why Katrina B was having a problem using these two modules together in Drupal 6, as I've done so in the past on multiple occasions. However, there is a problem using these two modules together in Drupal 7, and here's a patch to resolve it.
The problem is due to the removal of theme_menu_item_link from D7. In D6, Special Menu Items used this theme function to render certain "links" as span elements. Nice Menus would respect this rewrite in D6 because it was calling theme('menu_item_link', $menu_item['link']). In D7, Special Menu Items moved this functionality to theme_menu_link(). As the D7 version of Nice Menus doesn't call theme('menu_link', $variables) anywhere, it never sees the spans rendered by Special Menu Items.
This patch, rolled against master, changes that and also cleans up some redundant code. I couldn't figure out a "proper" way to pass child items to theme_menu_link such that the children would pass through theme_nice_menus_build instead of the default menu rendering, so I employed a bit of a dirty hack instead. I invite someone more versed in render arrays to improve upon this patch.
While inelegant, it works, and it restores to the D7 version functionality previously available in the D6 version. Please give this patch a test drive and let me know if it needs more work.
Comment #2
Anonymous (not verified) commentedRe-rolled patch to work with drush make against 7.x-2.0.
Comment #3
bschilt commentedI'm using Nice Menus with Special Menu Items to make a couple parent menu items render as . But the anchor tag was still being rendered resulting in a page not found error. I installed the patch at #1 and it fixed my issue.
Comment #4
mpotter commentedHere is an improved patch that works for me. It makes Nice Menus use standard D7 render arrays and theme calls. Seems to handle child menus correctly.
Comment #5
mpotter commentedHere is an updated patch with the dsm() removed!
Comment #6
mpotter commentedOK, let's try this one more time!
Comment #7
mpotter commentedAnd one more time to fix bug with $child needing to be $children for menuparent class to work.
Comment #8
mpotter commentedGeez, I'm a complete idiot today. Here is the above fix with the dsm removed again. Doh!
Comment #9
vordude commentedCommitted, Thanks.
http://drupalcode.org/project/nice_menus.git/blobdiff/0b0e4f5364b981ddd2...
Comment #10
aaronbaumanThis doesn't work anymore in the latest dev version.
Choosing a "nolink" menu item for the top-most parent results in a menu that starts with the first child, instead of the parent.
Any ideas?
Comment #11
aaronbaumannevermind, I think this is actually a different issue.