Fixed an error on the function "groups_get_tree"
This commit is contained in:
parent
c66ca5251a
commit
0b2c6f5c45
|
@ -1553,7 +1553,7 @@ function groups_get_tree(&$groups, $parent = false) {
|
||||||
$return = array();
|
$return = array();
|
||||||
|
|
||||||
foreach ($groups as $id => $group) {
|
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;
|
$return[$id] = $group;
|
||||||
unset($groups[$id]);
|
unset($groups[$id]);
|
||||||
$children = groups_get_tree($groups, $id);
|
$children = groups_get_tree($groups, $id);
|
||||||
|
|
Loading…
Reference in New Issue