Fix for If it's stupid and it works, it ain't stupid

  1. function mew_menu_rebuild() {
  2.   // Menu items can appear twice after overwriting them. The following
  3.   // workaround prevents this: disable all modules, rebuild the menu, enable
  4.   // all modules and rebuild the menu again. This doesn't work if all modules
  5.   // are disabled, because then there are no menu items, so we do this
  6.   // separately for Menu Wizard.
  7.   $modules = module_list();
  8.   unset($modules['mew']);
  9.   module_disable($modules);
  10.   menu_rebuild();
  11.   module_enable($modules);
  12.   menu_rebuild();
  13.   module_disable(array('mew'));
  14.   menu_rebuild();
  15.   module_enable(array('mew'));
  16.   menu_rebuild();
  17. }

Submit Fix

Any tags you'd like to associate with your code, delimitered by commas (example: Views, CCK, Module, etc).
Select the syntax highlighting mode to use.