diff options
Diffstat (limited to 'perllib/FixMyStreet/DB/Result/Problem.pm')
-rw-r--r-- | perllib/FixMyStreet/DB/Result/Problem.pm | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/perllib/FixMyStreet/DB/Result/Problem.pm b/perllib/FixMyStreet/DB/Result/Problem.pm index 9feb98c76..fac0fc7ef 100644 --- a/perllib/FixMyStreet/DB/Result/Problem.pm +++ b/perllib/FixMyStreet/DB/Result/Problem.pm @@ -653,7 +653,8 @@ sub body { my $body; if ($problem->external_body) { if ($problem->cobrand eq 'zurich') { - $body = $c->model('DB::Body')->find({ id => $problem->external_body }); + my $cache = $problem->result_source->schema->cache; + return $cache->{bodies}{$problem->external_body} //= $c->model('DB::Body')->find({ id => $problem->external_body }); } else { $body = $problem->external_body; } |