Fixed an error on the function "groups_get_tree"

This commit is contained in:
Alejandro Gallardo Escobar 2014-10-20 16:55:02 +02:00
parent 69954da39b
commit 5423b96cf3
1 changed files with 1 additions and 1 deletions

View File

@ -1553,7 +1553,7 @@ function groups_get_tree(&$groups, $parent = false) {
$return = array();
foreach ($groups as $id => $group) {
if ($parent === false && (!isset($group['parent']) || $group['parent'] == 0)) {
if ($parent === false && (!isset($group['parent']) || $group['parent'] == 0 || !in_array($group['parent'], $groups))) {
$return[$id] = $group;
unset($groups[$id]);
$children = groups_get_tree($groups, $id);