aboutsummaryrefslogtreecommitdiffstats
path: root/perllib/FixMyStreet/App/Controller/Contact.pm
diff options
context:
space:
mode:
authorStruan Donald <struan@exo.org.uk>2011-05-13 17:52:15 +0100
committerStruan Donald <struan@exo.org.uk>2011-05-13 17:52:15 +0100
commit8dae03ed508f07265727005bbce9570e51c6c33c (patch)
tree317f3abe8c092af4d8f44b4b7da0696f92cbf8db /perllib/FixMyStreet/App/Controller/Contact.pm
parentb683026c94f15f6f4b5214820b1446a8ef684658 (diff)
display correct error messages and test for bad problem ids
Diffstat (limited to 'perllib/FixMyStreet/App/Controller/Contact.pm')
-rw-r--r--perllib/FixMyStreet/App/Controller/Contact.pm5
1 files changed, 5 insertions, 0 deletions
diff --git a/perllib/FixMyStreet/App/Controller/Contact.pm b/perllib/FixMyStreet/App/Controller/Contact.pm
index 030f69cc2..bb3581144 100644
--- a/perllib/FixMyStreet/App/Controller/Contact.pm
+++ b/perllib/FixMyStreet/App/Controller/Contact.pm
@@ -114,6 +114,7 @@ sub determine_contact_type : Private {
elsif ($problem) {
$c->stash->{problem} = $problem;
}
+ $c->stash->{id} = $id;
}
return 1;
@@ -145,6 +146,10 @@ sub validate : Private {
or $c->req->param('update_id')
&& $c->req->param('update_id') !~ /^[1-9]\d*$/;
+ unshift @errors,
+ _('There were problems with your report. Please see below.')
+ if scalar keys %field_errors;
+
if ( @errors or scalar keys %field_errors ) {
$c->stash->{errors} = \@errors;
$c->stash->{field_errors} = \%field_errors;