When importing two structures into the same menu, the menu items are mixed. The second import should append to the existing menu.

Comments

pasqualle’s picture

quick code:

/**
 * Get max weight for first level.
 */
function menu_import_get_max_weight($menu_name) {
  $weight = db_query("SELECT MAX(weight) as max_weight FROM {menu_links} WHERE menu_name = :menu_name AND depth = 1",
    array(':menu_name' => $menu_name))->fetchField();
  if (empty($weight)) {
    $weight = 0;
  }
  return $weight;
}

then change default $weight arrays to:

  // Keep track of actual weights per level.
  $weights = array(0 => menu_import_get_max_weight($menu_name));
lex0r’s picture

Status: Active » Closed (fixed)

Fixed in 1.2-beta2.