aboutsummaryrefslogtreecommitdiffstats
path: root/perllib/FixMyStreet/App/Controller
diff options
context:
space:
mode:
Diffstat (limited to 'perllib/FixMyStreet/App/Controller')
-rw-r--r--perllib/FixMyStreet/App/Controller/Around.pm1
-rw-r--r--perllib/FixMyStreet/App/Controller/Reports.pm3
2 files changed, 4 insertions, 0 deletions
diff --git a/perllib/FixMyStreet/App/Controller/Around.pm b/perllib/FixMyStreet/App/Controller/Around.pm
index 8fed5c3aa..cc6f8387c 100644
--- a/perllib/FixMyStreet/App/Controller/Around.pm
+++ b/perllib/FixMyStreet/App/Controller/Around.pm
@@ -253,6 +253,7 @@ sub map_features : Private {
$c->forward( '/reports/stash_report_filter_status' );
$c->forward( '/reports/stash_report_sort', [ 'created-desc' ]);
+ $c->stash->{show_old_reports} = $c->get_param('show_old_reports');
return if $c->get_param('js'); # JS will request the same (or more) data client side
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;
}