Self-explanatory. Unless the module weight is set properly, menu_node_delete() fails to load the menu object.

Comments

agentrickard’s picture

Status: Active » Needs review
StatusFileSize
new2.12 KB

Patch

agentrickard’s picture

Also need this bit:

 function menu_node_delete_form_submit($form, &$form_state) {
   $mlid = $form_state['values']['mlid'];
-  $nid = menu_node_get_node($mlid, FALSE);
+  $node = menu_node_get_node($mlid, TRUE);
   // Is this a node item?
-  if (!empty($nid)) {
-    menu_node_delete($nid, $mlid);
+  if (!empty($node)) {
+    menu_node_delete($node);
   }
 }
 
@@ -341,8 +342,8 @@
   $items = menu_node_get_links_by_menu($menu_name);
   // We pass these individually in case any hook implementations care.
   foreach ($items as $mlid) {
-    $nid = menu_node_get_node($mlid, FALSE);
-    menu_node_delete($nid, $mlid);
+    $node = menu_node_get_node($mlid, TRUE);
+    menu_node_delete($node);
   }
 }
agentrickard’s picture

Status: Needs review » Fixed
StatusFileSize
new3.12 KB

Committed.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.