aboutsummaryrefslogtreecommitdiffstats
path: root/perllib/FixMyStreet
diff options
context:
space:
mode:
Diffstat (limited to 'perllib/FixMyStreet')
-rw-r--r--perllib/FixMyStreet/App/Controller/Report/New.pm8
1 files changed, 8 insertions, 0 deletions
diff --git a/perllib/FixMyStreet/App/Controller/Report/New.pm b/perllib/FixMyStreet/App/Controller/Report/New.pm
index 7468b0041..8c6c1b244 100644
--- a/perllib/FixMyStreet/App/Controller/Report/New.pm
+++ b/perllib/FixMyStreet/App/Controller/Report/New.pm
@@ -966,6 +966,14 @@ sub process_report : Private {
my $value = $c->get_param($form_name) || '';
$c->stash->{field_errors}->{$form_name} = _('This information is required')
if $field->{required} && !$value;
+ if ($field->{validator}) {
+ eval {
+ $value = $field->{validator}->($value);
+ };
+ if ($@) {
+ $c->stash->{field_errors}->{$form_name} = $@;
+ }
+ }
$report->set_extra_metadata( $form_name => $value );
}