aboutsummaryrefslogtreecommitdiffstats
path: root/perllib/FixMyStreet/App/Controller/Around.pm
diff options
context:
space:
mode:
authorMatthew Somerville <matthew@mysociety.org>2017-10-04 15:31:44 +0100
committerMatthew Somerville <matthew@mysociety.org>2017-10-05 13:07:41 +0100
commit861b3ace16097b5558d749210509afe4f0bdf70f (patch)
tree650eb3c0a8c0bbaeea63b4181bab62bda045dc43 /perllib/FixMyStreet/App/Controller/Around.pm
parentaed38e8dfca568ef4aabd8e222c03c6ac7bb69ad (diff)
Return page with "No results" if no ref found.
This lookup is often performed by inspectors with appcache switched on, which means they were getting the intercepted Glitch page rather than a 404; give them a no results page instead.
Diffstat (limited to 'perllib/FixMyStreet/App/Controller/Around.pm')
-rw-r--r--perllib/FixMyStreet/App/Controller/Around.pm8
1 files changed, 3 insertions, 5 deletions
diff --git a/perllib/FixMyStreet/App/Controller/Around.pm b/perllib/FixMyStreet/App/Controller/Around.pm
index db5361247..30c023317 100644
--- a/perllib/FixMyStreet/App/Controller/Around.pm
+++ b/perllib/FixMyStreet/App/Controller/Around.pm
@@ -373,13 +373,11 @@ sub lookup_by_ref : Private {
0;
};
- if ( $count == 0 ) {
- $c->detach( '/page_error_404_not_found', [] );
- } elsif ( $count == 1 ) {
- $c->res->redirect( $c->uri_for( '/report', $problems->first->id ) );
- } else {
+ if ($count > 1) {
$c->stash->{ref} = $ref;
$c->stash->{matching_reports} = [ $problems->all ];
+ } elsif ($count == 1) {
+ $c->res->redirect( $c->uri_for( '/report', $problems->first->id ) );
}
}