aboutsummaryrefslogtreecommitdiffstats
path: root/perllib/FixMyStreet/App/Controller/Report/New.pm
diff options
context:
space:
mode:
authorMatthew Somerville <matthew-github@dracos.co.uk>2016-06-27 18:09:27 +0100
committerMatthew Somerville <matthew-github@dracos.co.uk>2016-07-15 12:30:31 +0100
commit9e327d72fd7504c8f9f34dbdfd68856909446a40 (patch)
treee7dcebc2379d749937168b26d006711e41286242 /perllib/FixMyStreet/App/Controller/Report/New.pm
parent9af82f84b1cbdecca0fdf9c2d8a0067771cd461b (diff)
Check extras for all retrieved contacts.
Diffstat (limited to 'perllib/FixMyStreet/App/Controller/Report/New.pm')
-rw-r--r--perllib/FixMyStreet/App/Controller/Report/New.pm24
1 files changed, 12 insertions, 12 deletions
diff --git a/perllib/FixMyStreet/App/Controller/Report/New.pm b/perllib/FixMyStreet/App/Controller/Report/New.pm
index e81dc719f..5e6921ed9 100644
--- a/perllib/FixMyStreet/App/Controller/Report/New.pm
+++ b/perllib/FixMyStreet/App/Controller/Report/New.pm
@@ -877,20 +877,20 @@ sub process_report : Private {
}
my @extra;
- # NB: we are only checking extras for the *first* retrieved contact.
- my $metas = $contacts[0]->get_extra_fields();
-
- foreach my $field ( @$metas ) {
- if ( lc( $field->{required} ) eq 'true' ) {
- unless ( $c->get_param($field->{code}) ) {
- $c->stash->{field_errors}->{ $field->{code} } = _('This information is required');
+ foreach my $contact (@contacts) {
+ my $metas = $contact->get_extra_fields;
+ foreach my $field ( @$metas ) {
+ if ( lc( $field->{required} ) eq 'true' ) {
+ unless ( $c->get_param($field->{code}) ) {
+ $c->stash->{field_errors}->{ $field->{code} } = _('This information is required');
+ }
}
+ push @extra, {
+ name => $field->{code},
+ description => $field->{description},
+ value => $c->get_param($field->{code}) || '',
+ };
}
- push @extra, {
- name => $field->{code},
- description => $field->{description},
- value => $c->get_param($field->{code}) || '',
- };
}
if ( $c->stash->{non_public_categories}->{ $report->category } ) {