mirror of
https://github.com/silverstripe/silverstripe-cms
synced 2024-10-22 08:05:56 +02:00
Merge pull request #2011 from open-sausages/pulls/4.0/dont-give-me-a-falsified-report
BUG Fix ambiguous query for content report
This commit is contained in:
commit
a9cc93749d
@ -2,7 +2,9 @@
|
||||
|
||||
namespace SilverStripe\CMS\Reports;
|
||||
|
||||
use SilverStripe\CMS\Model\RedirectorPage;
|
||||
use SilverStripe\CMS\Model\SiteTree;
|
||||
use SilverStripe\ORM\DataList;
|
||||
use SilverStripe\Reports\Report;
|
||||
|
||||
class EmptyPagesReport extends Report
|
||||
@ -23,11 +25,18 @@ class EmptyPagesReport extends Report
|
||||
return 100;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the source records
|
||||
*
|
||||
* @param array $params
|
||||
* @return DataList
|
||||
*/
|
||||
public function sourceRecords($params = null)
|
||||
{
|
||||
return SiteTree::get()->where(
|
||||
"\"ClassName\" != 'RedirectorPage' AND (\"Content\" = '' OR \"Content\" IS NULL OR \"Content\" LIKE '<p></p>' OR \"Content\" LIKE '<p> </p>')"
|
||||
)->sort('Title');
|
||||
return SiteTree::get()
|
||||
->exclude('ClassName', RedirectorPage::class)
|
||||
->filter('Content', [null, '', '<p></p>', '<p> </p>'])
|
||||
->sort('Title');
|
||||
}
|
||||
|
||||
public function columns()
|
||||
|
Loading…
Reference in New Issue
Block a user