mirror of
https://github.com/silverstripe/silverstripe-contentreview
synced 2024-06-18 02:31:43 +02:00
FIX: Optimise PagesWithoutReviewScheduleReport database query
Drastically speeds up report generation on very large sites and reduces the likelyhood of running into memory issues.
This commit is contained in:
parent
c15888277d
commit
2fee654bb6
|
@ -111,7 +111,7 @@ class PagesWithoutReviewScheduleReport extends Report
|
|||
{
|
||||
Versioned::set_stage(Versioned::DRAFT);
|
||||
|
||||
$records = SiteTree::get();
|
||||
$records = SiteTree::get()->filter('NextReviewDate', null);
|
||||
$compatibility = ContentReviewCompatability::start();
|
||||
|
||||
// If there's no review dates set, default to all pages due for review now.
|
||||
|
@ -148,10 +148,6 @@ class PagesWithoutReviewScheduleReport extends Report
|
|||
*/
|
||||
protected function hasReviewSchedule(DataObject $record)
|
||||
{
|
||||
if (!$record->obj("NextReviewDate")->exists()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
$options = $record->getOptions();
|
||||
|
||||
if ($options && $options->OwnerGroups()->count() == 0 && $options->OwnerUsers()->count() == 0) {
|
||||
|
|
Loading…
Reference in New Issue
Block a user