Permalink
Browse files

MINOR using better sorting api (from r96483) (from r98197)

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/cms/trunk@105841 467b73ca-7a2a-4603-9d3b-597d59a354a9
  • Loading branch information...
1 parent 2e0afb8 commit 65a35d92fc32215e7c9dd32aa7dc406be437995b @chillu chillu committed May 28, 2010
Showing with 4 additions and 3 deletions.
  1. +4 −3 code/reports/BrokenLinksReport.php
@@ -11,9 +11,8 @@ function title() {
return _t('BrokenLinksReport.BROKENLINKS',"Broken links report");
}
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);
+ 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)");
$returnSet = new DataObjectSet();
if ($ret) foreach($ret as $record) {
@@ -51,6 +50,8 @@ function sourceRecords($params, $sort, $limit) {
}
}
+ if ($sort) $returnSet->sort($sort);
+
return $returnSet;
}
function columns() {

0 comments on commit 65a35d9

Please sign in to comment.