diff options
author | Struan Donald <struan@exo.org.uk> | 2011-05-13 17:52:15 +0100 |
---|---|---|
committer | Struan Donald <struan@exo.org.uk> | 2011-05-13 17:52:15 +0100 |
commit | 8dae03ed508f07265727005bbce9570e51c6c33c (patch) | |
tree | 317f3abe8c092af4d8f44b4b7da0696f92cbf8db /perllib | |
parent | b683026c94f15f6f4b5214820b1446a8ef684658 (diff) |
display correct error messages and test for bad problem ids
Diffstat (limited to 'perllib')
-rw-r--r-- | perllib/FixMyStreet/App/Controller/Contact.pm | 5 | ||||
-rw-r--r-- | perllib/FixMyStreet/TestMech.pm | 1 |
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} || []; |