On a fresh install of D7, latest media module (7.x-2.0-beta1) and latest md_megamenu, got a blank screen after adding a new MDMegaMenu, saving, and then editing. Apache log revealed the following:
PHP Fatal error: Call to undefined function media_browser_js() in /var/www/commerce/sites/all/modules/md_megamenu/includes/md_megamenu.utils.inc on line 627, referer: http://shop.norbest.com/admin/structure/md-megamenu
Traced to a change in media module 7.x-2.0-beta1, "the media browser settings were "simplified" and moved to a library which makes the media_attach_browser_js()
and media_browser_js()
helper functions unnecessary, since they require more code and the loading of a file, compared to simply attaching the library."
To correct this, open includes/md_megamenu.utils.inc, line 626 and replace:
module_load_include('inc', 'media', 'includes/media.browser');
$javascript = media_browser_js();
foreach ($javascript as $key => $definitions) {
foreach ($definitions as $definition) {
$function = 'drupal_add_' . $key;
call_user_func_array($function, $definition);
}
}
with
drupal_add_library('media', 'media_browser');
drupal_add_library('media', 'media_browser_settings');
Hope that helps someone...
Hi,
Thank you for your feedback.
It will help other customers and us so much. If you have any problem when using mega menu in the future, please feel free to tell us.
I've noticed this problem on MD Alpine as well. Fatal error: Call to undefined function media_browser_js() drupal. This fixed by modding sites/all/modules/custom/md_fullscreen_slider/inc/md_fullscreen_slider.utils.inc as follows:
Becomes:
Thanks to MeshBrains for the snippet.
Meshbrains;
Thanks for the tip. Helped me out!
LP
Please send me the update to solve the media module 7.x-2.0-beta1 issues as well. Thanks in advance.
Hi Eevensen,
We checked and could not see your purchase code of Mega menu. Please go to your account page (http://megadrupal.com/user/eevensen) to add your purchase code for updated files and more supports.