diff options
Diffstat (limited to 'perllib/FixMyStreet/App/Controller')
-rw-r--r-- | perllib/FixMyStreet/App/Controller/Around.pm | 6 | ||||
-rw-r--r-- | perllib/FixMyStreet/App/Controller/My.pm | 6 | ||||
-rw-r--r-- | perllib/FixMyStreet/App/Controller/Reports.pm | 10 |
3 files changed, 11 insertions, 11 deletions
diff --git a/perllib/FixMyStreet/App/Controller/Around.pm b/perllib/FixMyStreet/App/Controller/Around.pm index 341e26cca..7d382c228 100644 --- a/perllib/FixMyStreet/App/Controller/Around.pm +++ b/perllib/FixMyStreet/App/Controller/Around.pm @@ -165,10 +165,10 @@ sub display_location : Private { $c->stash->{all_pins} = $all_pins; my $interval = $all_pins ? undef : $c->cobrand->on_map_default_max_pin_age; - my $states = $c->cobrand->on_map_default_states; + my $states; $c->stash->{filter_status} = $c->cobrand->on_map_default_status; - my $status = $c->req->param('status') || ''; - if ( !defined $states || $status eq 'all' ) { + my $status = $c->req->param('status') || $c->cobrand->on_map_default_status; + if ( $status eq 'all' ) { $states = FixMyStreet::DB::Result::Problem->visible_states(); $c->stash->{filter_status} = 'all'; } elsif ( $status eq 'open' ) { diff --git a/perllib/FixMyStreet/App/Controller/My.pm b/perllib/FixMyStreet/App/Controller/My.pm index 5e9dc1219..0cea3735a 100644 --- a/perllib/FixMyStreet/App/Controller/My.pm +++ b/perllib/FixMyStreet/App/Controller/My.pm @@ -28,10 +28,10 @@ sub my : Path : Args(0) { my $p_page = $c->req->params->{p} || 1; my $u_page = $c->req->params->{u} || 1; - my $states = $c->cobrand->on_map_default_states; + my $states; $c->stash->{filter_status} = $c->cobrand->on_map_default_status; - my $status = $c->req->param('status') || ''; - if ( !defined $states || $status eq 'all' ) { + my $status = $c->req->param('status') || $c->cobrand->on_map_default_status; + if ( $status eq 'all' ) { $states = FixMyStreet::DB::Result::Problem->visible_states(); $c->stash->{filter_status} = 'all'; } elsif ( $status eq 'open' ) { diff --git a/perllib/FixMyStreet/App/Controller/Reports.pm b/perllib/FixMyStreet/App/Controller/Reports.pm index 99786269b..82418fc48 100644 --- a/perllib/FixMyStreet/App/Controller/Reports.pm +++ b/perllib/FixMyStreet/App/Controller/Reports.pm @@ -121,8 +121,8 @@ sub ward : Path : Args(2) { $c->stash->{stats} = $c->cobrand->get_report_stats(); $c->stash->{filter_status} = $c->cobrand->on_map_default_status; - my $status = $c->req->param('status') || ''; - if ( !defined $c->cobrand->on_map_default_states || $status eq 'all' ) { + my $status = $c->req->param('status') || $c->cobrand->on_map_default_status; + if ( $status eq 'all' ) { $c->stash->{filter_status} = 'all'; } elsif ( $status eq 'open' ) { $c->stash->{filter_status} = 'open'; @@ -399,9 +399,9 @@ sub load_and_group_problems : Private { # Unlike the 't' query param, 'status' isn't affected by # the age of a report, so treat the filtering separately. # If 't' is specified, it will override 'status'. - my $states = $c->cobrand->on_map_default_states; - my $status = $c->req->param('status') || ''; - if ( !defined $states || $status eq 'all' ) { + my $states; + my $status = $c->req->param('status') || $c->cobrand->on_map_default_status; + if ( $status eq 'all' ) { $states = FixMyStreet::DB::Result::Problem->visible_states(); } elsif ( $status eq 'open' ) { $states = FixMyStreet::DB::Result::Problem->open_states(); |