From d1a627bc143a4fd7fbcdc86e919ab7f89c29554b Mon Sep 17 00:00:00 2001 From: Ian Berry Date: Mon, 17 Mar 2003 03:32:13 +0000 Subject: [PATCH] more order key debug git-svn-id: svn+ssh://repo.cacti.net/var/data/svnroot/cacti/trunk/cacti@707 860744bd-22fc-0310-8c96-e9fe5004b5ca --- install/update_to_0_8.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/install/update_to_0_8.php b/install/update_to_0_8.php index f671576750..9b9e366763 100644 --- a/install/update_to_0_8.php +++ b/install/update_to_0_8.php @@ -582,7 +582,7 @@ function update_database($database_old, $database_username, $database_password) if (db_execute("insert into graph_tree (id,user_id,name) values (0,0,'" . $item["Name"] . "')")) { $graph_tree_id = db_fetch_insert_id(); $status_array{count($status_array)}["tree"][1] = $item["Name"]; - climb_tree(0, $item["ID"], 0, "", ""); + climb_tree(0, $item["ID"], 0, "", "", $database_old); $_tree_items = db_fetch_assoc("select * from $database_old.graph_hierarchy_items where TreeID=" . $item["ID"]); @@ -612,8 +612,8 @@ function update_database($database_old, $database_username, $database_password) return $status_array; } -function climb_tree($parent, $tree_id, $branch, $prefix_key, $item_count_array) { - global $database_old, $order_key_array; +function climb_tree($parent, $tree_id, $branch, $prefix_key, $item_count_array, $database_old) { + global $order_key_array; $tree = db_fetch_assoc("select ID from $database_old.graph_hierarchy_items where TreeID=$tree_id and Parent=$parent order by Sequence"); @@ -632,7 +632,7 @@ function climb_tree($parent, $tree_id, $branch, $prefix_key, $item_count_array) $order_key_array{$item["ID"]} = $order_key; if (sizeof(db_fetch_assoc("select ID from $database_old.graph_hierarchy_items where TreeID=$tree_id and Parent=" . $item["ID"])) > 0) { - climb_tree($item["ID"], $tree_id, ($branch+1), "$local_prefix_key", $item_count_array); + climb_tree($item["ID"], $tree_id, ($branch+1), "$local_prefix_key", $item_count_array, $database_old); } } }