diff options
author | Matthew Somerville <matthew-github@dracos.co.uk> | 2019-01-09 16:41:55 +0000 |
---|---|---|
committer | Matthew Somerville <matthew-github@dracos.co.uk> | 2019-01-10 09:50:35 +0000 |
commit | 7b2b0132c372fb840d3d1e130ce9a66fbb9ee75b (patch) | |
tree | 520ac074a1288ab81e11de5f12257fda12eda55a /perllib/FixMyStreet/App/Controller/Report/New.pm | |
parent | 205a8eb0c57e6616a537d1d83a9a4578baf59149 (diff) |
Allow override search to /report/new => /around.
This is so you can have a search box on an around page (wrapped in a
form going to /report/new) to start a new search, ignoring the lat/lon
that will also be submitted.
Diffstat (limited to 'perllib/FixMyStreet/App/Controller/Report/New.pm')
-rw-r--r-- | perllib/FixMyStreet/App/Controller/Report/New.pm | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/perllib/FixMyStreet/App/Controller/Report/New.pm b/perllib/FixMyStreet/App/Controller/Report/New.pm index ce2fe19f6..f8789fa3a 100644 --- a/perllib/FixMyStreet/App/Controller/Report/New.pm +++ b/perllib/FixMyStreet/App/Controller/Report/New.pm @@ -97,7 +97,7 @@ sub report_new : Path : Args(0) { # 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') - if !$c->forward('determine_location') || $c->get_param('filter_update'); + if !$c->forward('determine_location') || $c->get_param('pc_override') || $c->get_param('filter_update'); # create a problem from the submitted details $c->stash->{template} = "report/new/fill_in_details.html"; @@ -1558,6 +1558,12 @@ sub redirect_to_around : Private { $params->{$_} = $c->get_param($_); } + if (my $pc_override = $c->get_param('pc_override')) { + delete $params->{lat}; + delete $params->{lon}; + $params->{pc} = $pc_override; + } + my $csv = Text::CSV->new; foreach (qw(status filter_category)) { $csv->combine($c->get_param_list($_, 1)); |