diff options
author | Struan Donald <struan@exo.org.uk> | 2011-08-17 22:56:37 +0100 |
---|---|---|
committer | Struan Donald <struan@exo.org.uk> | 2011-08-17 22:56:37 +0100 |
commit | 3b5d561700b184c20e63111d4cbc1daab78e16c6 (patch) | |
tree | f0c53c6bf8d4ebf12e5388053ad856fb0d0e7b86 /perllib/FixMyStreet/App/Controller/Reports.pm | |
parent | 390f8e8ad1e10f832c4323c39bed2c883744a03f (diff) | |
parent | f38b8e985697c35a62374a2f02dce2d681ef58cd (diff) |
Merge branch 'master' of ssh://git.mysociety.org/data/git/public/fixmystreet into new_statuses
Conflicts:
db/schema.sql
perllib/FixMyStreet/App/Controller/Admin.pm
perllib/FixMyStreet/DB/Result/User.pm
t/app/controller/admin.t
templates/web/default/admin/update_edit.html
web/css/core.css
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 821b650ed..bf270a3b2 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; } } |