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.
| Comment | File | Size | Author |
|---|---|---|---|
| #5 | features-undefined-index-in-menu_links_features_rebuild_ordered-2509022-2.patch | 466 bytes | eugene.ilyin |
Comments
Comment #1
eugene.ilyin commentedComment #2
eugene.ilyin commentedThis simple patch solves this problem
Comment #3
eugene.ilyin commentedComment #5
eugene.ilyin commentedSorry, first patch was wrong
Comment #7
mpotter commentedYep, seems like an obvious error and fix. Committed to 938a7c5.
Comment #8
eugene.ilyin commentedThank you
Comment #10
eugene.ilyin commentedComment #11
Devestaaron commented#5 fixed it for me. Thanks!