BUGFIX Fixed Group::collateFamilyIDs() when working with MSSQL

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/branches/2.4@91775 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
Sean Harvey 2009-11-16 05:02:19 +00:00 committed by Sam Minnee
parent f9c0ce652d
commit 797715ef78

View File

@ -262,18 +262,19 @@ class Group extends DataObject {
$chunkToAdd = array(array("ID" => $this->ID));
while($chunkToAdd) {
$idList = null;
$idList = array();
foreach($chunkToAdd as $item) {
$idList[] = $item['ID'];
$familyIDs[] = $item['ID'];
}
$idList = implode(',',$idList);
$idList = implode(',', $idList);
// Get the children of *all* the groups identified in the previous chunk.
// This minimises the number of SQL queries necessary
$sql = $this->extendedSQL("\"ParentID\" IN ($idList)", "");
$chunkToAdd = $sql->execute();
if(!$chunkToAdd->column()) $chunkToAdd = null;
$dbResult = $sql->execute();
$chunkToAdd = array();
foreach($dbResult as $item) $chunkToAdd[] = $item;
}
return $familyIDs;