aboutsummaryrefslogtreecommitdiffstats
path: root/perllib/FixMyStreet/App/Controller/Reports.pm
diff options
context:
space:
mode:
Diffstat (limited to 'perllib/FixMyStreet/App/Controller/Reports.pm')
-rw-r--r--perllib/FixMyStreet/App/Controller/Reports.pm3
1 files changed, 3 insertions, 0 deletions
diff --git a/perllib/FixMyStreet/App/Controller/Reports.pm b/perllib/FixMyStreet/App/Controller/Reports.pm
index dc9e2c913..05776a94f 100644
--- a/perllib/FixMyStreet/App/Controller/Reports.pm
+++ b/perllib/FixMyStreet/App/Controller/Reports.pm
@@ -758,10 +758,13 @@ sub stash_report_sort : Private {
$sort =~ /^(updated|created|comments)-(desc|asc)$/;
my $order_by = $types{$1} || $1;
+ # field to use for report age cutoff
+ $c->stash->{report_age_field} = $order_by eq 'comment_count' ? 'lastupdate' : $order_by;
my $dir = $2;
$order_by = { -desc => $order_by } if $dir eq 'desc';
$c->stash->{sort_order} = $order_by;
+
return 1;
}