This is a code snippet from menu_tree_output():

$element['#theme'] = 'menu_link__' . $data['link']['menu_name'];

As you can see, the function here defines a theme suggestion that uses the base theme function theme_menu_link() but also the menu's name as additional possibility for menu specific theming. The problem is, that menus often have a "-" in their name like for example main-menu or secondary-links. For those it is impossible to invoke a function since "-" is not allowed in function names. The menu_tree_output() function should check the menu name string for forbidden signs before and strip it accordingly.

CommentFileSizeAuthor
#3 757940.patch713 bytesygerasimov

Comments

fubhy-’s picture

By "signs" I mean characters of course. Excuse my bad english please :P

Anonymous’s picture

Checked in Beta 1 and the theme_wrappers function for outer markup has invalid characters replaced correctly, but the theme_wrappers function for menu links does not.

The line 1004 $element['#theme'] = 'menu_link__' . $data['link']['menu_name']; should read as follows:

$element['#theme'] = 'menu_link__' . strtr($data['link']['menu_name'], '-', '_');

ygerasimov’s picture

Status: Active » Needs review
StatusFileSize
new713 bytes

Great catch. Here is patch for #2.

elijah lynn’s picture

Issue summary: View changes
Status: Needs review » Closed (duplicate)
elijah lynn’s picture