Index: modules/taxonomy/taxonomy.admin.inc =================================================================== RCS file: /cvs/drupal/drupal/modules/taxonomy/taxonomy.admin.inc,v retrieving revision 1.25 diff -u -p -r1.25 taxonomy.admin.inc --- modules/taxonomy/taxonomy.admin.inc 14 Apr 2008 17:48:42 -0000 1.25 +++ modules/taxonomy/taxonomy.admin.inc 22 Apr 2008 01:19:31 -0000 @@ -297,12 +297,14 @@ function taxonomy_overview_terms(&$form_ else { $term_deltas = array(); $tree = taxonomy_get_tree($vocabulary->vid); - $term = current($tree); + $tree_index = 0; do { // In case this tree is completely empty. - if (empty($term)) { + if (empty($tree[$tree_index])) { break; } + $term = $tree[$tree_index]; + // Count entries before the current page. if ($page && ($page * $page_increment) > $before_entries && !isset($back_peddle)) { $before_entries++; @@ -317,11 +319,11 @@ function taxonomy_overview_terms(&$form_ // Do not let a term start the page that is not at the root. if (isset($term->depth) && ($term->depth > 0) && !isset($back_peddle)) { $back_peddle = 0; - while ($pterm = prev($tree)) { + while ($pterm = $tree[--$tree_index]) { $before_entries--; $back_peddle++; if ($pterm->depth == 0) { - prev($tree); + $tree_index--; continue 2; // Jump back to the start of the root level parent. } } @@ -353,7 +355,7 @@ function taxonomy_overview_terms(&$form_ $root_entries++; } $current_page[$key] = $term; - } while ($term = next($tree)); + } while (isset($tree[++$tree_index])); // Because we didn't use a pager query, set the necessary pager variables. $total_entries = $before_entries + $page_entries + $after_entries;