diff --git a/includes/menu.inc b/includes/menu.inc index b43042d01afc..f52fff4867fe 100644 --- a/includes/menu.inc +++ b/includes/menu.inc @@ -596,8 +596,10 @@ function menu_rebuild() { } } + $old_count = -1; // Save the new items updating the pids in each iteration - while (count($new_items)) { + while (($c = count($new_items)) && ($c != $old_count)) { + $old_count = count($new_items); foreach($new_items as $mid => $item) { // If the item has a valid parent, save it if ($item['pid'] >= 0) {