diff options
author | Dave Arter <davea@mysociety.org> | 2018-10-15 16:23:58 +0100 |
---|---|---|
committer | Dave Arter <davea@mysociety.org> | 2018-10-17 12:59:41 +0100 |
commit | 08e335ce05c81db337f3f7623e1e3fe734546ce9 (patch) | |
tree | 3c2fcbc82e2ca735e03717a6ad23b51be1c4dbb2 /perllib/FixMyStreet/App/Controller/Admin.pm | |
parent | a1122f6d8b3cd4fe35724ab5b4d234ee33670e87 (diff) |
Update areas when moving report pin
The change in report_inspect.t from WODC to Oxford City was necessary
because moving reports to a location not in Mock::MapIt was resulting in
an empties bodies_str in the "test category/body changes" test.
Fixes #2181.
Diffstat (limited to 'perllib/FixMyStreet/App/Controller/Admin.pm')
-rw-r--r-- | perllib/FixMyStreet/App/Controller/Admin.pm | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/perllib/FixMyStreet/App/Controller/Admin.pm b/perllib/FixMyStreet/App/Controller/Admin.pm index 504de19ca..8ccc5b8d3 100644 --- a/perllib/FixMyStreet/App/Controller/Admin.pm +++ b/perllib/FixMyStreet/App/Controller/Admin.pm @@ -1082,6 +1082,7 @@ sub report_edit_location : Private { # this lookup is bad. So let's save the stash and restore it after the # comparison. my $safe_stash = { %{$c->stash} }; + $c->stash->{fetch_all_areas} = 1; $c->forward('/council/load_and_check_areas', []); $c->forward('/report/new/setup_categories_and_bodies'); my %allowed_bodies = map { $_ => 1 } @{$problem->bodies_str_ids}; @@ -1091,6 +1092,8 @@ sub report_edit_location : Private { return unless $bodies_match; $problem->latitude($c->stash->{latitude}); $problem->longitude($c->stash->{longitude}); + my $areas = $c->stash->{all_areas_mapit}; + $problem->areas( ',' . join( ',', sort keys %$areas ) . ',' ); } return 1; } |