BUG Don't convert datalist to arraylist when filtering pages

Fixes #2354
This commit is contained in:
Damian Mooyman 2019-01-18 09:27:55 +13:00
parent 9ccba1b0bb
commit 9ced23473f
No known key found for this signature in database
GPG Key ID: 4327857F75021D92

View File

@ -41,11 +41,10 @@ class CMSSiteTreeFilter_PublishedPages extends CMSSiteTreeFilter
*/
public function getFilteredPages()
{
$pages = Versioned::get_including_deleted(SiteTree::class);
$pages = $this->applyDefaultFilters($pages);
$pages = $pages->filterByCallback(function (SiteTree $page) {
return $page->isPublished();
});
return $pages;
return Versioned::get_including_deleted(SiteTree::class)
->innerJoin(
'SiteTree_Live',
'"SiteTree_Versions"."RecordID" = "SiteTree_Live"."ID"'
);
}
}