mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
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:
parent
f9c0ce652d
commit
797715ef78
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user