BUGFIX: Better broken reason sorting (from r96989)

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/cms/branches/2.4@98205 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
Sam Minnee 2010-02-04 04:55:28 +00:00
parent 21a9fec0ba
commit faa812e45b

View File

@ -12,6 +12,7 @@ class BrokenLinksReport extends SSReport {
}
function sourceRecords($params, $sort, $limit) {
$join = '';
$sortBrokenReason = false;
if($sort) {
$parts = explode(' ', $sort);
$field = $parts[0];
@ -22,7 +23,8 @@ class BrokenLinksReport extends SSReport {
} elseif($field == 'Subsite.Title') {
$join = 'LEFT JOIN "Subsite" ON "Subsite"."ID" = "SiteTree"."SubsiteID"';
} elseif($field == 'BrokenReason') {
$sort = "HasBrokenLink $direction, HasBrokenFile $direction";
$sortBrokenReason = true;
$sort = '';
}
}
@ -65,7 +67,7 @@ class BrokenLinksReport extends SSReport {
}
}
//if ($sort) $returnSet->sort($sort);
if($sortBrokenReason) $returnSet->sort('BrokenReason', $direction);
return $returnSet;
}