mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 12:05:37 +00:00
BUGFIX Convert pages from DataList to ArrayList in CMSBatchActionHandler to avoid problems on merge()
This commit is contained in:
parent
d04fe07fa6
commit
64db811d65
@ -111,8 +111,14 @@ class CMSBatchActionHandler extends RequestHandler {
|
||||
implode(", ", $idsFromLive)
|
||||
);
|
||||
$livePages = Versioned::get_by_stage($this->recordClass, 'Live', $sql);
|
||||
if($pages) $pages->merge($livePages);
|
||||
else $pages = $livePages;
|
||||
if($pages) {
|
||||
// Can't merge into a DataList, need to condense into an actual list first
|
||||
// (which will retrieve all records as objects, so its an expensive operation)
|
||||
$pages = new ArrayList($pages->toArray());
|
||||
$pages->merge($livePages);
|
||||
} else {
|
||||
$pages = $livePages;
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
|
Loading…
x
Reference in New Issue
Block a user