using megamenu with the i18n module in the 7 dev version gives the following error>
Fatal error: Call to undefined function i18nmenu_localize_tree() in /yoursite/sites/all/modules/megamenu/megamenu.module on line 217

CommentFileSizeAuthor
#6 megamenu-il8n.patch1.26 KBmikefyfer

Comments

Jean Gionet’s picture

I'm experiencing the same issue. Is there a fix or workaround for this?

Webqam’s picture

You can try to
in megamenu.module :

change

if (module_exists('i18n')) {
    i18nmenu_localize_tree($menutree);
  }

by

  if (module_exists('i18n')) {
    i18n_menu_localize_tree($menutree);
  }

And in megamenu.utilities.inc

change

  if (module_exists('i18n')) {
    $item['title']  = _i18nmenu_get_item_title($item);
  }

by

  if (module_exists('i18nmenu/i18nmenu')) {
    $item['title']  = _i18nmenu_get_item_title($item);
  }
ozsi’s picture

I'v made some changes to work megamenu module with the i18n_menu module.

I changed in the megamenu.module:

at line 46:

  if (module_exists('i18n')) {
    module_load_include('module', 'i18n', 'i18nmenu/i18nmenu');
  }

to:

  if (module_exists('i18n')) {
    module_load_include('module', 'i18n', 'i18n_menu/i18n_menu');	
  }

(Because the module name changed.)

at line 213:

if (module_exists('i18n')) {
    i18nmenu_localize_tree($menutree);
  }

to:

  if (function_exists('i18n_menu_localize_tree')) {
   $menutree = i18n_menu_localize_tree($menutree);
  }

(according http://drupal.org/node/1114010).

In the megamenu.utilities.inc at line 244:

  if (module_exists('i18n')) {
    $item['title']  = _i18nmenu_get_item_title($item);
  }

to:

  if (module_exists('i18n_menu')) {
    $item['title']  = _i18n_menu_link_title($item);
  }
mattez’s picture

Same issue. Can anybody create a patch, please?

alexbk66-’s picture

I think that it's better (and faster) to check if (function_exists('i18n_menu_localize_tree')) instead of if (module_exists('i18n'))

mikefyfer’s picture

StatusFileSize
new1.26 KB

Had the same issue. Making the changes in comment #3 worked for me, i attached a patch of those changes.

the main problem, as stated in #3 is that the module name changed... =/

webcultist’s picture

The patch works for me. =)

mzwyssig’s picture

Status: Active » Reviewed & tested by the community

patch #6 works for me too, thanks.

webadpro’s picture

Can this patch be push to the Dev?

luco’s picture

Status: Reviewed & tested by the community » Needs review

hey there,

I applied the patch but the error didn't go away. I think tere's still something missing.

cheers,
Luciano

webadpro’s picture

Have you tried clearing your site cache?

luco’s picture

yes, I did. now the error is Fatal error: Call to undefined function i18n_string_translate() in (...) \sites\all\modules\i18n\i18n_menu\i18n_menu.module on line 463

juampynr’s picture

Priority: Major » Critical
Status: Needs review » Reviewed & tested by the community

Reviewed.

Applies cleanly and fixes the issue.

Raised priority to critical as it breaks the site when i18n has been enabled.

alexbk66-’s picture

May I ask a stupid question? Why need i18nmenu_localize_tree() at all?

menu_tree_check_access() in menu.inc calls _menu_link_translate() anyway. I commented out i18nmenu_localize_tree() and it still works fine!

Note: I'm still in D6 though.

Anonymous’s picture

Assigned: Unassigned »
Issue tags: +lowhanging
Anonymous’s picture

Status: Reviewed & tested by the community » Closed (fixed)

Committed to 7.x-1.x in 5557ccf