diff options
-rw-r--r-- | perllib/FixMyStreet/App/Controller/Report/New.pm | 2 | ||||
-rw-r--r-- | perllib/FixMyStreet/App/Controller/Report/Update.pm | 7 | ||||
-rw-r--r-- | perllib/FixMyStreet/Cobrand/FixMyStreet.pm | 12 |
3 files changed, 12 insertions, 9 deletions
diff --git a/perllib/FixMyStreet/App/Controller/Report/New.pm b/perllib/FixMyStreet/App/Controller/Report/New.pm index 70ed0cd73..5bf184ae6 100644 --- a/perllib/FixMyStreet/App/Controller/Report/New.pm +++ b/perllib/FixMyStreet/App/Controller/Report/New.pm @@ -872,7 +872,7 @@ sub process_report : Private { }; } - $c->cobrand->process_extras( $c, \@contacts, \@extra ); + $c->cobrand->process_extras( $c, $contacts[0]->area_id, \@extra ); if ( @extra ) { $c->stash->{report_meta} = \@extra; diff --git a/perllib/FixMyStreet/App/Controller/Report/Update.pm b/perllib/FixMyStreet/App/Controller/Report/Update.pm index e0433473d..779c74f03 100644 --- a/perllib/FixMyStreet/App/Controller/Report/Update.pm +++ b/perllib/FixMyStreet/App/Controller/Report/Update.pm @@ -201,13 +201,16 @@ sub process_update : Private { $update->problem_state( $params{state} ); } + my @extra; # Next function fills this, but we don't need it here. + # This is just so that the error checkign for these extra fields runs. + # TODO Use extra here as it is used on reports. + $c->cobrand->process_extras( $c, $update->problem->council, \@extra ); + if ( $c->req->param('fms_extra_title') ) { my %extras = (); $extras{title} = $c->req->param('fms_extra_title'); $extras{email_alerts_requested} = $c->req->param('add_alert'); $update->extra( \%extras ); - - $c->stash->{fms_extra_title} = $c->req->param('fms_extra_title'); } if ( $c->stash->{ first_name } && $c->stash->{ last_name } ) { diff --git a/perllib/FixMyStreet/Cobrand/FixMyStreet.pm b/perllib/FixMyStreet/Cobrand/FixMyStreet.pm index c2ba60786..d32e876bb 100644 --- a/perllib/FixMyStreet/Cobrand/FixMyStreet.pm +++ b/perllib/FixMyStreet/Cobrand/FixMyStreet.pm @@ -54,13 +54,13 @@ sub generate_problem_banner { } sub process_extras { - my $self = shift; - my $ctx = shift; - my $contacts = shift; - my $extra = shift; - my $fields = shift || []; + my $self = shift; + my $ctx = shift; + my $area_id = shift; + my $extra = shift; + my $fields = shift || []; - if ( $contacts->[0]->area_id == 2482 ) { + if ( $area_id == 2482 ) { my @fields = ( 'fms_extra_title', @$fields ); for my $field ( @fields ) { my $value = $ctx->request->param( $field ); |