diff options
author | Matthew Somerville <matthew@mysociety.org> | 2012-03-16 13:38:53 +0000 |
---|---|---|
committer | Matthew Somerville <matthew@mysociety.org> | 2012-03-16 13:38:53 +0000 |
commit | 257d609b986b5f70282c68b75858cc5f2323a400 (patch) | |
tree | 3bc172aa1e96b9c0902dbc45accd13f731d5db51 /perllib/FixMyStreet/App/Controller | |
parent | ce6daecdf96955aab2f1d528d3fdc2f56213f400 (diff) |
Return an error if map clicked outside boundary, fixes #270.
Diffstat (limited to 'perllib/FixMyStreet/App/Controller')
-rw-r--r-- | perllib/FixMyStreet/App/Controller/Report/New.pm | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/perllib/FixMyStreet/App/Controller/Report/New.pm b/perllib/FixMyStreet/App/Controller/Report/New.pm index 8d249b899..af4cdd5aa 100644 --- a/perllib/FixMyStreet/App/Controller/Report/New.pm +++ b/perllib/FixMyStreet/App/Controller/Report/New.pm @@ -109,9 +109,14 @@ sub report_form_ajax : Path('ajax') : Args(0) { $c->forward('initialize_report'); # work out the location for this report and do some checks - # XXX We don't want to do this here if this actually happens! - return $c->forward('redirect_to_around') - unless $c->forward('determine_location'); + if ( ! $c->forward('determine_location') ) { + my $body = JSON->new->utf8(1)->encode( { + error => $c->stash->{location_error}, + } ); + $c->res->content_type('application/json; charset=utf-8'); + $c->res->body($body); + return; + } $c->forward('setup_categories_and_councils'); |