aboutsummaryrefslogtreecommitdiffstats
path: root/perllib/FixMyStreet/App
diff options
context:
space:
mode:
Diffstat (limited to 'perllib/FixMyStreet/App')
-rw-r--r--perllib/FixMyStreet/App/Controller/Report/New.pm15
1 files changed, 9 insertions, 6 deletions
diff --git a/perllib/FixMyStreet/App/Controller/Report/New.pm b/perllib/FixMyStreet/App/Controller/Report/New.pm
index a9814e426..6aaa4531f 100644
--- a/perllib/FixMyStreet/App/Controller/Report/New.pm
+++ b/perllib/FixMyStreet/App/Controller/Report/New.pm
@@ -854,12 +854,6 @@ sub process_report : Private {
$bodies = join( ',', @{ $c->stash->{bodies_to_list} } ) || -1;
$report->bodies_str( $bodies );
- my %extra;
- $c->cobrand->process_open311_extras( $c, undef, \%extra );
- if ( %extra ) {
- $report->extra( \%extra );
- }
-
} elsif ( $report->category ) {
# FIXME All contacts were fetched in setup_categories_and_bodies,
@@ -950,6 +944,15 @@ sub process_report : Private {
}
+ # Get a list of custom form fields we want and store them in extra metadata
+ foreach my $field ($c->cobrand->report_form_extras) {
+ my $form_name = $field->{name};
+ my $value = $c->get_param($form_name) || '';
+ $c->stash->{field_errors}->{$form_name} = _('This information is required')
+ if $field->{required} && !$value;
+ $report->set_extra_metadata( $form_name => $value );
+ }
+
# set defaults that make sense
$report->state('unconfirmed');