aboutsummaryrefslogtreecommitdiffstats
path: root/perllib/FixMyStreet/App/Controller/Reports.pm
diff options
context:
space:
mode:
authorMatthew Somerville <matthew@mysociety.org>2015-07-06 17:35:35 +0100
committerMatthew Somerville <matthew@mysociety.org>2015-07-07 14:13:18 +0100
commita978c0a1ad216f7004ef88b8a58b9731242155dc (patch)
tree58ec3daece503b314bb1dfe54ab2d0c0e80cb24e /perllib/FixMyStreet/App/Controller/Reports.pm
parentbeb7e1f345ace940c542d93768ec44bfd6f5dc21 (diff)
Factor out all uses of param()/params.
Use a central get_param and get_param_list functions dependent on whether we're after a scalar or a list (almost always a scalar). This prevents any possibility of confusion where param() could return a list, or params->{} an arrayref.
Diffstat (limited to 'perllib/FixMyStreet/App/Controller/Reports.pm')
-rw-r--r--perllib/FixMyStreet/App/Controller/Reports.pm10
1 files changed, 5 insertions, 5 deletions
diff --git a/perllib/FixMyStreet/App/Controller/Reports.pm b/perllib/FixMyStreet/App/Controller/Reports.pm
index 5a044c9af..6b0d516a6 100644
--- a/perllib/FixMyStreet/App/Controller/Reports.pm
+++ b/perllib/FixMyStreet/App/Controller/Reports.pm
@@ -128,7 +128,7 @@ sub ward : Path : Args(2) {
} )->all;
@categories = map { $_->category } @categories;
$c->stash->{filter_categories} = \@categories;
- $c->stash->{filter_category} = $c->req->param('filter_category');
+ $c->stash->{filter_category} = $c->get_param('filter_category');
my $pins = $c->stash->{pins};
@@ -383,10 +383,10 @@ sub check_canonical_url : Private {
sub load_and_group_problems : Private {
my ( $self, $c ) = @_;
- my $page = $c->req->params->{p} || 1;
+ my $page = $c->get_param('p') || 1;
# NB: If 't' is specified, it will override 'status'.
- my $type = $c->req->params->{t} || 'all';
- my $category = $c->req->params->{c} || $c->req->params->{filter_category} || '';
+ my $type = $c->get_param('t') || 'all';
+ my $category = $c->get_param('c') || $c->get_param('filter_category') || '';
my $states = $c->stash->{filter_problem_states};
my $where = {
@@ -500,7 +500,7 @@ sub redirect_body : Private {
sub stash_report_filter_status : Private {
my ( $self, $c ) = @_;
- my $status = $c->req->param('status') || $c->cobrand->on_map_default_status;
+ my $status = $c->get_param('status') || $c->cobrand->on_map_default_status;
if ( $status eq 'all' ) {
$c->stash->{filter_status} = 'all';
$c->stash->{filter_problem_states} = FixMyStreet::DB::Result::Problem->visible_states();