diff options
author | Matthew Somerville <matthew-github@dracos.co.uk> | 2018-09-25 18:53:21 +0100 |
---|---|---|
committer | Matthew Somerville <matthew-github@dracos.co.uk> | 2018-09-25 18:53:21 +0100 |
commit | 2e8ea6b187eb4219021bff009d8f1c6a87f75564 (patch) | |
tree | 9eb950378ad673326fa17d0b373141dcaf553e52 /perllib/FixMyStreet/App/Controller/Admin.pm | |
parent | da2026df7210cd772d40a7f619ec6ff8563800d7 (diff) | |
parent | cdd94a3de1445d0aea4dfc8c18cbae9e315bdda9 (diff) |
Merge branch 'body-list-speedup'
Diffstat (limited to 'perllib/FixMyStreet/App/Controller/Admin.pm')
-rw-r--r-- | perllib/FixMyStreet/App/Controller/Admin.pm | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/perllib/FixMyStreet/App/Controller/Admin.pm b/perllib/FixMyStreet/App/Controller/Admin.pm index 7c81251e8..1158b688a 100644 --- a/perllib/FixMyStreet/App/Controller/Admin.pm +++ b/perllib/FixMyStreet/App/Controller/Admin.pm @@ -2147,10 +2147,14 @@ sub check_page_allowed : Private { sub fetch_all_bodies : Private { my ($self, $c ) = @_; - my @bodies = $c->model('DB::Body')->translated->all_sorted; - if ( $c->cobrand->moniker eq 'zurich' ) { - @bodies = $c->cobrand->admin_fetch_all_bodies( @bodies ); - } + my @bodies = $c->cobrand->call_hook('admin_fetch_all_bodies') || do { + 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; + }; + $c->stash->{bodies} = \@bodies; return 1; |