diff options
author | Matthew Somerville <matthew@mysociety.org> | 2013-02-20 15:56:53 +0000 |
---|---|---|
committer | Matthew Somerville <matthew@mysociety.org> | 2013-02-20 16:38:58 +0000 |
commit | 9ce6e383640811b9b51ffe7a46c1b5dfac66e14c (patch) | |
tree | 784164cfa8af0ebbb16c6e75bf571dadaf36368d /perllib/FixMyStreet/App/Controller/Location.pm | |
parent | 577e26282626ef640aa75dbc02e727a3977a1784 (diff) |
Redirect to front page if nothing provided.
Diffstat (limited to 'perllib/FixMyStreet/App/Controller/Location.pm')
-rw-r--r-- | perllib/FixMyStreet/App/Controller/Location.pm | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/perllib/FixMyStreet/App/Controller/Location.pm b/perllib/FixMyStreet/App/Controller/Location.pm index fd3fadd9f..f103ff7f9 100644 --- a/perllib/FixMyStreet/App/Controller/Location.pm +++ b/perllib/FixMyStreet/App/Controller/Location.pm @@ -50,6 +50,8 @@ sub determine_location_from_coords : Private { User has searched for a location - try to find it for them. +Return -1 if nothing provided. + If one match is found returns true and lat/lng is set. If several possible matches are found puts an array onto stash so that user can be prompted to pick one and returns false. @@ -62,7 +64,7 @@ sub determine_location_from_pc : Private { my ( $self, $c, $pc ) = @_; # check for something to search - $pc ||= $c->req->param('pc') || return; + $pc ||= $c->req->param('pc') || return -1; $c->stash->{pc} = $pc; # for template if ( $pc =~ /^(-?\d+(?:\.\d+)?)\s*,\s*(-?\d+(?:\.\d+)?)$/ ) { |