Merge pull request #2370 from tractorcow/pulls/4.2/published-filter-page

BUG Don't convert datalist to arraylist when filtering pages
This commit is contained in:
Robbie Averill 2019-01-18 08:29:45 +01:00 committed by GitHub
commit eb62e11d75
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

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"'
);
}
}