aboutsummaryrefslogtreecommitdiffstats
path: root/perllib/FixMyStreet/DB/ResultSet/Body.pm
diff options
context:
space:
mode:
Diffstat (limited to 'perllib/FixMyStreet/DB/ResultSet/Body.pm')
-rw-r--r--perllib/FixMyStreet/DB/ResultSet/Body.pm8
1 files changed, 8 insertions, 0 deletions
diff --git a/perllib/FixMyStreet/DB/ResultSet/Body.pm b/perllib/FixMyStreet/DB/ResultSet/Body.pm
index 1855a45c1..4e9661d2e 100644
--- a/perllib/FixMyStreet/DB/ResultSet/Body.pm
+++ b/perllib/FixMyStreet/DB/ResultSet/Body.pm
@@ -149,9 +149,17 @@ sub all_sorted {
})->all;
@bodies = sort { strcoll($a->{msgstr} || $a->{name}, $b->{msgstr} || $b->{name}) } @bodies;
+ my $cobrand = $rs->result_source->schema->cobrand;
+
foreach my $body (@bodies) {
$body->{parent} = { id => $body->{parent}, name => $body->{parent_name} } if $body->{parent};
+ # DEPRECATED: url(c, query_params) -> url
+ $body->{url} = sub {
+ my ($c, $args) = @_;
+ return FixMyStreet::DB::Result::Body::_url($body, $cobrand, $args);
+ };
+
# DEPRECATED: get_column('area_count') -> area_count
next unless defined $body->{area_count};
$body->{get_column} = sub {