This module is no nice, it's perfekt for adding id's and Classes to menu items. Please port it to drupal 7, I think it couldn't be very difficult, or is it? I'm sorry, my php knowledge is very small..

Comments

killes@www.drop.org’s picture

Assigned: Breakerandi » Unassigned

I may do that when I find some time...

Patches are welcome...

Island Usurper’s picture

Status: Active » Needs review
StatusFileSize
new1.44 KB

Ta-da!

gagarine’s picture

Assigned: Unassigned » gagarine
stevieb’s picture

StatusFileSize
new126.63 KB

after updating a site from d6 - d7

I get the following errors with the patch in #2
Notice: Undefined index: original_item in menu_html_form_alter() (line 8 of .../sites/all/modules/menu_html/menu_html.module).
also the tick box "Allow html" keeps reverting to unselected

the links from the d6 site still show - properly formatted - but new links don't accept the html (see img)

lucascaro’s picture

Well, this worked for me dor drupal 7.12 so maybe the only thing missing is an upgrade path for d6 -> d7?

lucascaro’s picture

StatusFileSize
new470 bytes

After using it for a while, I saw the error message reported by stevieb when editing a node, it seems to come from the line 8 at menu_html.module:

  if ($form_id == 'menu_edit_item' || strpos($form_id, '_node_form') > 0) {

in particular from the part that reads || strpos($form_id, '_node_form') > 0 since it's trying to edit the node form whi doesn't have an element named 'original_item'.

There are 2 solutions to this bug.
a) removing the condition and not triggering the behavior on node_forms. Unless there is a particular reason to alter that form, this should be the chosen solution.
b) handle node_form correctly and alter the right element, which I couldn't find so far.

I'm locally doing a) and I'll post a patch here so other people can test it.

Josephnewyork’s picture

Version: 6.x-1.x-dev » 6.x-1.1
StatusFileSize
new650 bytes

Didn't look and see this post before I wrote the D7 version, but I attached my D7 version of this if anyone is interested. Lightly tested, working fine. Code very similar to original 6.

jive01’s picture

I can confirm that the above module works like a charm for D7. Be warned, the tar inside is marked menu_html-7.x.tar_ so I had to rename the file.

Please make this an official port.

gagarine’s picture

Version: 6.x-1.1 » 7.x-1.x-dev
Status: Needs review » Fixed

I just push my version.... please open new bug and keep this one close.

stevieb’s picture

just to confirm the patch in #6 works

gagarine’s picture

@stevieb you can use the 7.x-1.x-dev version on the project page. I will release a stable one after some peoples use it...

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.