From 399b2a23da8b24d8445a848f4fdffbd2df0de44e Mon Sep 17 00:00:00 2001 From: Josh Date: Fri, 14 Sep 2012 12:12:37 -0300 Subject: [PATCH] FIXED: collateFamilyIDs() nested groups throws error http://open.silverstripe.org/ticket/7835 --- security/Group.php | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/security/Group.php b/security/Group.php index fcda3738d..7880e7d90 100755 --- a/security/Group.php +++ b/security/Group.php @@ -271,15 +271,11 @@ class Group extends DataObject { */ 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