From b6a2a3746fd9dd46609c1f7cdacea434a20117ea Mon Sep 17 00:00:00 2001 From: Ingo Schommer Date: Fri, 28 May 2010 02:32:13 +0000 Subject: [PATCH] BUGFIX: Better broken reason sorting (from r96989) (from r98205) git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/cms/trunk@105850 467b73ca-7a2a-4603-9d3b-597d59a354a9 --- code/reports/BrokenLinksReport.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/code/reports/BrokenLinksReport.php b/code/reports/BrokenLinksReport.php index 18fade7c..497c9834 100644 --- a/code/reports/BrokenLinksReport.php +++ b/code/reports/BrokenLinksReport.php @@ -12,6 +12,7 @@ class BrokenLinksReport extends SS_Report { } function sourceRecords($params, $sort, $limit) { $join = ''; + $sortBrokenReason = false; if($sort) { $parts = explode(' ', $sort); $field = $parts[0]; @@ -22,7 +23,8 @@ class BrokenLinksReport extends SS_Report { } 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 SS_Report { } } - //if ($sort) $returnSet->sort($sort); + if($sortBrokenReason) $returnSet->sort('BrokenReason', $direction); return $returnSet; }