aboutsummaryrefslogtreecommitdiffstats
path: root/perllib/FixMyStreet
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
parentb683026c94f15f6f4b5214820b1446a8ef684658 (diff)
display correct error messages and test for bad problem ids
Diffstat (limited to 'perllib/FixMyStreet')
-rw-r--r--perllib/FixMyStreet/App/Controller/Contact.pm5
-rw-r--r--perllib/FixMyStreet/TestMech.pm1
2 files changed, 6 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;
diff --git a/perllib/FixMyStreet/TestMech.pm b/perllib/FixMyStreet/TestMech.pm
index ee59bded6..160b3955a 100644
--- a/perllib/FixMyStreet/TestMech.pm
+++ b/perllib/FixMyStreet/TestMech.pm
@@ -219,6 +219,7 @@ sub page_errors {
my $mech = shift;
my $result = scraper {
process 'p.error', 'errors[]', 'TEXT';
+ process 'ul.error', 'errors[]', 'TEXT';
}
->scrape( $mech->response );
return $result->{errors} || [];