diff options
author | Matthew Somerville <matthew@mysociety.org> | 2015-07-06 17:35:35 +0100 |
---|---|---|
committer | Matthew Somerville <matthew@mysociety.org> | 2015-07-07 14:13:18 +0100 |
commit | a978c0a1ad216f7004ef88b8a58b9731242155dc (patch) | |
tree | 58ec3daece503b314bb1dfe54ab2d0c0e80cb24e /perllib/FixMyStreet/App/Controller/Dashboard.pm | |
parent | beb7e1f345ace940c542d93768ec44bfd6f5dc21 (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/Dashboard.pm')
-rw-r--r-- | perllib/FixMyStreet/App/Controller/Dashboard.pm | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/perllib/FixMyStreet/App/Controller/Dashboard.pm b/perllib/FixMyStreet/App/Controller/Dashboard.pm index c2b0a2ee2..c3aa35008 100644 --- a/perllib/FixMyStreet/App/Controller/Dashboard.pm +++ b/perllib/FixMyStreet/App/Controller/Dashboard.pm @@ -32,9 +32,9 @@ sub example : Local : Args(0) { #$c->forward( '/report/new/setup_categories_and_bodies' ); # See if we've had anything from the dropdowns - perhaps vary results if so - $c->stash->{ward} = $c->req->param('ward'); - $c->stash->{category} = $c->req->param('category'); - $c->stash->{q_state} = $c->req->param('state'); + $c->stash->{ward} = $c->get_param('ward'); + $c->stash->{category} = $c->get_param('category'); + $c->stash->{q_state} = $c->get_param('state'); eval { my $data = File::Slurp::read_file( @@ -108,8 +108,8 @@ sub index : Path : Args(0) { # See if we've had anything from the dropdowns - $c->stash->{ward} = $c->req->param('ward'); - $c->stash->{category} = $c->req->param('category'); + $c->stash->{ward} = $c->get_param('ward'); + $c->stash->{category} = $c->get_param('category'); my %where = ( bodies_str => $body->id, # XXX Does this break in a two tier council? Restriction needs looking at... @@ -143,7 +143,7 @@ sub index : Path : Args(0) { # List of reports underneath summary table - $c->stash->{q_state} = $c->req->param('state') || ''; + $c->stash->{q_state} = $c->get_param('state') || ''; if ( $c->stash->{q_state} eq 'fixed' ) { $prob_where->{'me.state'} = [ FixMyStreet::DB::Result::Problem->fixed_states() ]; } elsif ( $c->stash->{q_state} ) { @@ -170,7 +170,7 @@ sub index : Path : Args(0) { } $c->stash->{lists} = \%problems; - if ( $c->req->params->{export} ) { + if ( $c->get_param('export') ) { $self->export_as_csv($c, $problems_rs, $body); } } |