From abb711e323edab55c638d9f7824e2f6757e3b1c7 Mon Sep 17 00:00:00 2001 From: Alejandro Gallardo Escobar Date: Thu, 22 Jan 2015 18:19:38 +0100 Subject: [PATCH] Error fixes --- pandora_console/include/class/Tree.class.php | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/pandora_console/include/class/Tree.class.php b/pandora_console/include/class/Tree.class.php index 14b0d9980b..fe6fbaace2 100644 --- a/pandora_console/include/class/Tree.class.php +++ b/pandora_console/include/class/Tree.class.php @@ -1466,12 +1466,11 @@ class Tree { } } else { - $rootIDs = $this->rootID; + $servers = metaconsole_get_servers(); $item_list = array(); - foreach ($rootIDs as $serverID => $rootID) { - $this->rootID = $rootID; - $items = $this->getItems($serverID); + foreach ($servers as $server) { + $items = $this->getItems($server['id']); // Build the group hierarchy $processed_items = array(); @@ -1481,7 +1480,7 @@ class Tree { } $item_list += $processed_items; } - $this->rootID = $rootIDs; + if (!empty($item_list)) usort($item_list, "cmpSortNames");