aboutsummaryrefslogtreecommitdiffstats
path: root/perllib/FixMyStreet/Map.pm
diff options
context:
space:
mode:
authorDave Arter <davea@mysociety.org>2015-03-20 17:49:40 +0000
committerSteven Day <steve@mysociety.org>2015-06-29 12:43:01 +0100
commita76bd2ab4910aedd589b12ee857091d11b9db30b (patch)
tree057e444c2892e467101d7904c48bf87b1bc926f2 /perllib/FixMyStreet/Map.pm
parentbadc0954505c93c12a8ecf4932245958425d15ec (diff)
Use a consistent method of filtering by category on /around and /ajax
Diffstat (limited to 'perllib/FixMyStreet/Map.pm')
-rw-r--r--perllib/FixMyStreet/Map.pm6
1 files changed, 4 insertions, 2 deletions
diff --git a/perllib/FixMyStreet/Map.pm b/perllib/FixMyStreet/Map.pm
index 2606fd9a4..7db4a7e3d 100644
--- a/perllib/FixMyStreet/Map.pm
+++ b/perllib/FixMyStreet/Map.pm
@@ -120,9 +120,11 @@ sub map_pins {
my $category = $c->req->param('category');
# Filter reports by status, if present in query params
+ my $states = $c->cobrand->on_map_default_states;
my $status = $c->req->param('status') || '';
- my $states;
- if ( $status eq 'open' ) {
+ if ( !defined $states || $status eq 'all' ) {
+ $states = FixMyStreet::DB::Result::Problem->visible_states();
+ } elsif ( $status eq 'open' ) {
$states = FixMyStreet::DB::Result::Problem->open_states();
} elsif ( $status eq 'fixed' ) {
$states = FixMyStreet::DB::Result::Problem->fixed_states();