diff options
author | Struan Donald <struan@exo.org.uk> | 2011-08-03 09:50:05 +0100 |
---|---|---|
committer | Struan Donald <struan@exo.org.uk> | 2011-08-03 09:50:05 +0100 |
commit | dbaf8d84b9cd52380a031b801370bb6a0f8e4c22 (patch) | |
tree | d1841a90f8536ca17df49e2b667b4d3a096de31e /perllib/FixMyStreet/App/Controller/Reports.pm | |
parent | 9415569a17bf3044c7f3253c923f556436d48942 (diff) | |
parent | 76f39991e1caf89e12e8bb8f49ba0a99df56f3dc (diff) |
Merge branch 'master' of ssh://git.mysociety.org/data/git/public/fixmystreet into open311-consumer
Diffstat (limited to 'perllib/FixMyStreet/App/Controller/Reports.pm')
-rw-r--r-- | perllib/FixMyStreet/App/Controller/Reports.pm | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/perllib/FixMyStreet/App/Controller/Reports.pm b/perllib/FixMyStreet/App/Controller/Reports.pm index 61d7d5cb1..feafc4b77 100644 --- a/perllib/FixMyStreet/App/Controller/Reports.pm +++ b/perllib/FixMyStreet/App/Controller/Reports.pm @@ -124,7 +124,9 @@ sub ward : Path : Args(2) { # List of wards unless ($c->stash->{ward}) { - my $children = mySociety::MaPit::call('area/children', $c->stash->{council}->{id} ); + my $children = mySociety::MaPit::call('area/children', $c->stash->{council}->{id}, + type => $mySociety::VotingArea::council_child_types, + ); foreach (values %$children) { $_->{url} = $c->uri_for( $c->stash->{council_url} . '/' . $c->cobrand->short_name( $_ ) @@ -269,9 +271,9 @@ sub ward_check : Private { type => $mySociety::VotingArea::council_child_types, min_generation => $c->cobrand->area_min_generation ); - foreach my $id (sort keys %$qw) { - if ($qw->{$id}->{parent_area} == $council->{id}) { - $c->stash->{ward} = $qw->{$id}; + foreach my $area (sort { $a->{name} cmp $b->{name} } values %$qw) { + if ($area->{parent_area} == $council->{id}) { + $c->stash->{ward} = $area; return; } } |