aboutsummaryrefslogtreecommitdiffstats
path: root/perllib
diff options
context:
space:
mode:
authorMatthew Somerville <matthew-github@dracos.co.uk>2016-06-08 12:31:46 +0100
committerMatthew Somerville <matthew-github@dracos.co.uk>2016-07-06 12:52:37 +0100
commit49782c333a340a667009eed261d0ef0ceb419f88 (patch)
treeced110d72f6e8684e6287c8e14e9c54c0b70680c /perllib
parent525c7f29761a158748cd068e3432115cd25b9f4c (diff)
Redirect correctly if filter used sans JavaScript.
It was being treated as a new report and showing errors, rather than showing you the same page with updated filters. Fixes #1422.
Diffstat (limited to 'perllib')
-rw-r--r--perllib/FixMyStreet/App/Controller/Report/New.pm7
1 files changed, 5 insertions, 2 deletions
diff --git a/perllib/FixMyStreet/App/Controller/Report/New.pm b/perllib/FixMyStreet/App/Controller/Report/New.pm
index 76098c119..696234d32 100644
--- a/perllib/FixMyStreet/App/Controller/Report/New.pm
+++ b/perllib/FixMyStreet/App/Controller/Report/New.pm
@@ -83,8 +83,9 @@ sub report_new : Path : Args(0) {
$c->forward('initialize_report');
# work out the location for this report and do some checks
+ # Also show map if we're just updating the filters
return $c->forward('redirect_to_around')
- unless $c->forward('determine_location');
+ if $c->get_param('filter_update') || !$c->forward('determine_location');
# create a problem from the submitted details
$c->stash->{template} = "report/new/fill_in_details.html";
@@ -1229,10 +1230,12 @@ sub redirect_to_around : Private {
my ( $self, $c ) = @_;
my $params = {
- pc => ( $c->stash->{pc} || $c->get_param('pc') || '' ),
lat => $c->stash->{latitude},
lon => $c->stash->{longitude},
};
+ foreach (qw(pc zoom status filter_category)) {
+ $params->{$_} = $c->get_param($_);
+ }
# delete empty values
for ( keys %$params ) {