See:

http://drupal.org/node/966508#comment-4103828

Example:

Primary links:
Home
About >
About 1
About 2

When I edit "about" then the submenu items disappear. When i edit about 1 via drupal primary links block and save it again, the menu works again with submenu items..

Comments

rhmtts’s picture

Status: Active » Needs review

Found it.

The problem is in the _multiple_node_menu_submit($node) function. It fails to preserve the value of the "has_children" field for the original menu item. This field is used by the Superfish module (and possibly by others) to determine whether a sub menu needs to be shown or not.

The solution is to retrieve the value of this field, store it and save it back for all the new menu items.

Here's the patch:

--- multiple_node_menu.module	(revision 319)
+++ multiple_node_menu.module	(working copy)
@@ -118,8 +118,10 @@
   $new_links = array();
 
   $results = db_query("SELECT * FROM {menu_links} where router_path = 'node/%' AND link_path = 'node/%d' ORDER BY weight ASC", $node->nid);
+  $has_children = 0; // this information in the original rows needs to be preserved
   while ($row = db_fetch_array($results)) {
     $original_links[$row['mlid']] = $row;
+    $has_children = $row['has_children'];
   }
 
     $first_original_link = reset($original_links);
@@ -151,6 +153,7 @@
       'plid'        => $plid,
       'weight'      => $new_link['link_weight'],
       'link_path'   => 'node/' . $node->nid,
+      'has_children' => $has_children,
     );
 
     if ($new_link['link_enable'] != 1) {

DrPhunk’s picture

I've used the above patch but still seem to have the same issue. Could there be any other changes that need to be made?

rhmtts’s picture

Ah, yes. You need to go into the database and reset has_children to the correct value. Either that or you can go to one of the children of the broken submenu and save it. This will also reset the value of has_children to the correct value.

mrfelton’s picture

Marked #933948: Modifying has_children as a duplicate.

mrfelton’s picture

Here is a patch.

mrfelton’s picture

StatusFileSize
new471 bytes

Actually, I think the proposed patch in the other issue was better. Here is a patch for that.

technikh’s picture

subscribing

PeteS’s picture

Assigned: Unassigned » PeteS
jarrodirwin’s picture

Issue summary: View changes
Status: Needs review » Reviewed & tested by the community

Patch #6 works as expected and fixes the issue whereby the 'has_children' value is currently being lost on node save.

I vote this is RTBC.