aboutsummaryrefslogtreecommitdiffstats
path: root/perllib/FixMyStreet/App/Controller/Reports.pm
diff options
context:
space:
mode:
authorMatthew Somerville <matthew@mysociety.org>2012-12-14 19:07:08 +0000
committerMatthew Somerville <matthew@mysociety.org>2012-12-19 14:43:26 +0000
commitddf9dbdbf6486c781ca4a5822614b0b7cee2c062 (patch)
tree09c12affc3390138b03292d3f90810287b4941d0 /perllib/FixMyStreet/App/Controller/Reports.pm
parentda29e8a75eaa92e98807ad89d29d3d1f3c01bc14 (diff)
Allow bodies to span multiple area IDs, and areas can be covered by more than one body.
Diffstat (limited to 'perllib/FixMyStreet/App/Controller/Reports.pm')
-rw-r--r--perllib/FixMyStreet/App/Controller/Reports.pm6
1 files changed, 3 insertions, 3 deletions
diff --git a/perllib/FixMyStreet/App/Controller/Reports.pm b/perllib/FixMyStreet/App/Controller/Reports.pm
index 630409227..bf65fe1d5 100644
--- a/perllib/FixMyStreet/App/Controller/Reports.pm
+++ b/perllib/FixMyStreet/App/Controller/Reports.pm
@@ -99,7 +99,7 @@ sub ward : Path : Args(2) {
$c,
latitude => @$pins ? $pins->[0]{latitude} : 0,
longitude => @$pins ? $pins->[0]{longitude} : 0,
- area => $c->stash->{ward} ? $c->stash->{ward}->{id} : $c->stash->{body}->area_id,
+ area => $c->stash->{ward} ? $c->stash->{ward}->{id} : [ keys %{$c->stash->{body}->areas} ],
pins => $pins,
any_zoom => 1,
);
@@ -109,7 +109,7 @@ sub ward : Path : Args(2) {
# List of wards
# Ignore external_body special body thing
unless ($c->stash->{ward} || !$c->stash->{body}->id) {
- my $children = mySociety::MaPit::call('area/children', [ $c->stash->{body}->area_id ],
+ my $children = mySociety::MaPit::call('area/children', [ $c->stash->{body}->body_areas->first->area_id ],
type => $c->cobrand->area_types_children,
);
unless ($children->{error}) {
@@ -301,7 +301,7 @@ sub ward_check : Private {
# Could be from RSS area, or body...
my $parent_id;
if ( $c->stash->{body} ) {
- $parent_id = $c->stash->{body}->area_id;
+ $parent_id = $c->stash->{body}->body_areas->first->area_id;
} else {
$parent_id = $c->stash->{area}->{id};
}