Details
-
Type: Bug
-
Status: Done/Fixed
-
Priority: Major
-
Resolution: Fixed/Completed
-
Affects Version/s: 4.4.1, 4.4.2, 4.4.3, 4.4.4, 4.4.5
-
Fix Version/s: 4.5
-
Component/s: Core CiviCRM
-
Labels:
Description
In the function getGroupsHierarchy() the fetched query is parsed correctly, but then the $root array is created. With fetched roots. But when security restrictions applied, for example, a user (group admin) is allowed to operate only with one group, or a set of groups without parents (roots) provided (in different hierarchical levels; or when security limitations applied), no parent information provided (but all fetched groups are with parents, for example), the returned (by the function) groupsReturn array is empty.
So, we need to parse groups left in $rows after the next loop:
while (count($roots))
Proposal: insert the small part of code here
foreach($rows as $value)
$groups[$value['id']] = array($value['prefix'], $value['title']);
// Prefix titles with the calcuated spacing to give the visual
// appearance of ordering when transformed into HTML in the form layer. Add description and visibility.
$groupsReturn = array();
Thanx!