diff --git a/admin_menu.install b/admin_menu.install index 61f3b7c..c5d1baf 100644 --- a/admin_menu.install +++ b/admin_menu.install @@ -97,3 +97,20 @@ function admin_menu_update_7303() { ->execute(); } +/** + * Remove obsolete 'admin_menu' menu and all orphan links in it. + */ +function admin_menu_update_7304() { + // 6.x-1.x cloned the entire link structure below the path 'admin' into a + // separate 'menu_name' "admin_menu" with 'module' "admin_menu". 6.x-3.x and + // early alpha versions of 7.x-3.x still did something similar. All of these + // records are obsolete. Removal of the 'module' records (without different + // menu_name) is particularly important, since they would otherwise appear + // as duplicate links. + db_delete('menu_links') + ->condition(db_or() + ->condition('module', 'admin_menu') + ->condition('menu_name', 'admin_menu') + ) + ->execute(); +}