Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

MINOR fix sorting in this report. (from r96481) (from r98196)

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/cms/trunk@105840 467b73ca-7a2a-4603-9d3b-597d59a354a9
  • Loading branch information...
commit 2e0afb879e37e55315fdd6625c319a43bdb06432 1 parent 388d474
@chillu chillu authored
Showing with 4 additions and 3 deletions.
  1. +4 −3 code/reports/BrokenLinksReport.php
View
7 code/reports/BrokenLinksReport.php
@@ -10,9 +10,10 @@ class BrokenLinksReport extends SS_Report {
function title() {
return _t('BrokenLinksReport.BROKENLINKS',"Broken links report");
}
- function sourceRecords($params = null) {
- if (!isset($_REQUEST['CheckSite']) || $params['CheckSite'] == 'Published') $ret = Versioned::get_by_stage('SiteTree', 'Live', "(HasBrokenLink = 1 OR HasBrokenFile = 1)");
- else $ret = DataObject::get('SiteTree', "(HasBrokenFile = 1 OR HasBrokenLink = 1)");
+ function sourceRecords($params, $sort, $limit) {
+ if(!$sort || !in_array(preg_replace('/(\s+?)(A|DE)SC$/', '', $sort), array('Title','LastEdited'))) $sort = "LastEdited ASC";
+ if (!isset($_REQUEST['CheckSite']) || $params['CheckSite'] == 'Published') $ret = Versioned::get_by_stage('SiteTree', 'Live', "(HasBrokenLink = 1 OR HasBrokenFile = 1)", $sort);
+ else $ret = DataObject::get('SiteTree', "(HasBrokenFile = 1 OR HasBrokenLink = 1)", $sort);
$returnSet = new DataObjectSet();
if ($ret) foreach($ret as $record) {
Please sign in to comment.
Something went wrong with that request. Please try again.