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/Cobrand/UK.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/Cobrand/UK.pm')
-rw-r--r-- | perllib/FixMyStreet/Cobrand/UK.pm | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/perllib/FixMyStreet/Cobrand/UK.pm b/perllib/FixMyStreet/Cobrand/UK.pm index cd64de9c6..b293c3568 100644 --- a/perllib/FixMyStreet/Cobrand/UK.pm +++ b/perllib/FixMyStreet/Cobrand/UK.pm @@ -37,7 +37,7 @@ sub process_extras { if ( $body_id eq '2482' ) { my @fields = ( 'fms_extra_title', @$fields ); for my $field ( @fields ) { - my $value = $ctx->request->param( $field ); + my $value = $ctx->get_param($field); if ( !$value ) { $ctx->stash->{field_errors}->{ $field } = _('This information is required'); @@ -49,8 +49,8 @@ sub process_extras { }; } - if ( $ctx->request->param('fms_extra_title') ) { - $ctx->stash->{fms_extra_title} = $ctx->request->param('fms_extra_title'); + if ( $ctx->get_param('fms_extra_title') ) { + $ctx->stash->{fms_extra_title} = $ctx->get_param('fms_extra_title'); $ctx->stash->{extra_name_info} = 1; } } |