I've got error like
Undefined index: main-menu_news:news in [notice] menu_links_features_rebuild_ordered() (line 325 of /var/www/xxx/sites/all/modules/contrib/features/includes/features.menu.inc). in #927566

It's occured due this operation in features.menu.inc

 // Order all links by depth.
    if ($unordered) {
      do {
        $current = count($unordered);
        foreach ($unordered as $key => $link) {
          $identifier = menu_links_features_identifier($link);
          $parent = isset($link['parent_identifier']) ? $link['parent_identifier'] : '';
          $weight = 0;
          // Parent has been seen, so weigh this above parent.
          if (isset($ordered[$parent])) {
            $weight = $ordered[$parent] + 1;
          }
          // Next loop will try to find parent weight instead.
          elseif ($parent) {
            continue;
          }
          $ordered[$identifier] = $weight;
          $all_links[$identifier] = $link;
          unset($unordered[$key]);
        }
      // Exit out when the above does no changes this loop.
      } while (count($unordered) < $current);
    }

After that we added remaining links

    // Add all remaining unordered items to the ordered list.
    foreach ($unordered as $link) {
      $identifier = menu_links_features_identifier($link);
      $ordered[$identifier] = 0;
    }

But we should add $link into $all_links also.

Comments

eugene.ilyin’s picture

Title: Undefined index: main-menu_news:news in [notice] menu_links_features_rebuild_ordered() (line 325 of /var/www/xxx/sites/all/modules/contrib/features/includes/features.menu.inc). » Undefined index in menu_links_features_rebuild_ordered
eugene.ilyin’s picture

This simple patch solves this problem

eugene.ilyin’s picture

Status: Active » Needs review

Status: Needs review » Needs work
eugene.ilyin’s picture

Status: Needs work » Needs review
StatusFileSize
new466 bytes

Sorry, first patch was wrong

mpotter’s picture

Status: Needs review » Fixed

Yep, seems like an obvious error and fix. Committed to 938a7c5.

eugene.ilyin’s picture

Thank you

Status: Fixed » Closed (fixed)

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

eugene.ilyin’s picture

Devestaaron’s picture

#5 fixed it for me. Thanks!