aboutsummaryrefslogtreecommitdiffstats
path: root/perllib/FixMyStreet/App/Controller/Admin.pm
diff options
context:
space:
mode:
Diffstat (limited to 'perllib/FixMyStreet/App/Controller/Admin.pm')
-rw-r--r--perllib/FixMyStreet/App/Controller/Admin.pm7
1 files changed, 4 insertions, 3 deletions
diff --git a/perllib/FixMyStreet/App/Controller/Admin.pm b/perllib/FixMyStreet/App/Controller/Admin.pm
index d757cec9a..75684c773 100644
--- a/perllib/FixMyStreet/App/Controller/Admin.pm
+++ b/perllib/FixMyStreet/App/Controller/Admin.pm
@@ -2211,13 +2211,14 @@ sub check_page_allowed : Private {
sub fetch_all_bodies : Private {
my ($self, $c ) = @_;
- my @bodies = $c->cobrand->call_hook('admin_fetch_all_bodies') || do {
+ my @bodies = $c->cobrand->call_hook('admin_fetch_all_bodies');
+ if (!@bodies) {
my $bodies = $c->model('DB::Body')->search(undef, {
columns => [ "id", "name", "deleted", "parent" ],
})->with_parent_name;
$bodies = $bodies->with_defect_type_count if $c->stash->{with_defect_type_count};
- $bodies->translated->all_sorted;
- };
+ @bodies = $bodies->translated->all_sorted;
+ }
$c->stash->{bodies} = \@bodies;