Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
FIXED: collateFamilyIDs() nested groups throws error
  • Loading branch information
theorytank committed Sep 14, 2012
1 parent 7a8c35f commit 399b2a2
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions security/Group.php
Expand Up @@ -271,15 +271,11 @@ public static function map($filter = "", $sort = "", $blank="") {
*/
public function collateFamilyIDs() {
$familyIDs = array();
$chunkToAdd = array(array("ID" => $this->ID));
$chunkToAdd = array($this->ID);

while($chunkToAdd) {
$idList = array();
foreach($chunkToAdd as $item) {
$idList[] = $item['ID'];
$familyIDs[] = $item['ID'];
}
$idList = implode(',', $idList);
$familyIDs = array_merge($familyIDs,$chunkToAdd);
$idList = implode(',', $chunkToAdd);

// Get the children of *all* the groups identified in the previous chunk.
// This minimises the number of SQL queries necessary
Expand Down

0 comments on commit 399b2a2

Please sign in to comment.