mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-06 16:18:41 +02:00
Merge pull request #795 from theorytank/3.0
FIX: collateFamilyIDs() nested groups throws error
This commit is contained in:
commit
86dc36ca21
@ -271,15 +271,11 @@ class Group extends DataObject {
|
|||||||
*/
|
*/
|
||||||
public function collateFamilyIDs() {
|
public function collateFamilyIDs() {
|
||||||
$familyIDs = array();
|
$familyIDs = array();
|
||||||
$chunkToAdd = array(array("ID" => $this->ID));
|
$chunkToAdd = array($this->ID);
|
||||||
|
|
||||||
while($chunkToAdd) {
|
while($chunkToAdd) {
|
||||||
$idList = array();
|
$familyIDs = array_merge($familyIDs,$chunkToAdd);
|
||||||
foreach($chunkToAdd as $item) {
|
$idList = implode(',', $chunkToAdd);
|
||||||
$idList[] = $item['ID'];
|
|
||||||
$familyIDs[] = $item['ID'];
|
|
||||||
}
|
|
||||||
$idList = implode(',', $idList);
|
|
||||||
|
|
||||||
// Get the children of *all* the groups identified in the previous chunk.
|
// Get the children of *all* the groups identified in the previous chunk.
|
||||||
// This minimises the number of SQL queries necessary
|
// This minimises the number of SQL queries necessary
|
||||||
|
Loading…
Reference in New Issue
Block a user