diff options
-rw-r--r-- | perllib/FixMyStreet/App/Controller/Alert.pm | 9 | ||||
-rw-r--r-- | t/app/controller/alert.t | 2 |
2 files changed, 11 insertions, 0 deletions
diff --git a/perllib/FixMyStreet/App/Controller/Alert.pm b/perllib/FixMyStreet/App/Controller/Alert.pm index 0c434cbe0..bdcaccc3a 100644 --- a/perllib/FixMyStreet/App/Controller/Alert.pm +++ b/perllib/FixMyStreet/App/Controller/Alert.pm @@ -74,6 +74,10 @@ sub list :Path('list') :Args(0) { # Try to create a location for whatever we have unless ($c->forward('/location/determine_location_from_coords') || $c->forward('/location/determine_location_from_pc') ) { + if ( $c->stash->{possible_location_matches} ) { + $c->stash->{choose_target_uri} = $c->uri_for( '/alert/list' ); + $c->detach('choose'); + } # FIXME: do error display here # return FixMyStreet::Geocode::list_choices($error, '/alert', $q) if ref($error) eq 'ARRAY'; # return alert_front_page($q, $error) if $error; @@ -352,6 +356,11 @@ sub prettify_pc : Private { $c->stash->{pretty_pc} = $pretty_pc; } +sub choose : Private { + my ( $self, $c ) = @_; + $c->stash->{template} = 'alert/choose.html'; +} + =head1 AUTHOR diff --git a/t/app/controller/alert.t b/t/app/controller/alert.t index 25feaf20d..80037fafe 100644 --- a/t/app/controller/alert.t +++ b/t/app/controller/alert.t @@ -25,4 +25,6 @@ $mech->title_like(qr/^Local RSS feeds and email alerts/); $mech->content_contains('Local RSS feeds and email alerts for ZZ9 9ZY'); $mech->content_contains('html lang="en-gb"'); +$mech->get_ok('/alert/list?pc=High Street'); +$mech->content_contains('We found more than one match for that location'); done_testing(); |