diff options
Diffstat (limited to 'perllib')
-rw-r--r-- | perllib/FixMyStreet/App/Controller/Reports.pm | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/perllib/FixMyStreet/App/Controller/Reports.pm b/perllib/FixMyStreet/App/Controller/Reports.pm index 005397fda..356578bb0 100644 --- a/perllib/FixMyStreet/App/Controller/Reports.pm +++ b/perllib/FixMyStreet/App/Controller/Reports.pm @@ -392,10 +392,11 @@ sub ward_check : Private { my $qw = mySociety::MaPit::call('area/children', [ $parent_id ], type => $c->cobrand->area_types_children, ); - my %names = map { $_ => 1 } @wards; + my %names = map { $c->cobrand->short_name({ name => $_ }) => 1 } @wards; my @areas; foreach my $area (sort { $a->{name} cmp $b->{name} } values %$qw) { - push @areas, $area if $names{$area->{name}}; + my $name = $c->cobrand->short_name($area); + push @areas, $area if $names{$name}; } if (@areas) { $c->stash->{ward} = $areas[0] if @areas == 1; |