aboutsummaryrefslogtreecommitdiffstats
path: root/perllib/FixMyStreet/DB
diff options
context:
space:
mode:
Diffstat (limited to 'perllib/FixMyStreet/DB')
-rw-r--r--perllib/FixMyStreet/DB/Result/Body.pm6
-rw-r--r--perllib/FixMyStreet/DB/Result/Problem.pm4
2 files changed, 6 insertions, 4 deletions
diff --git a/perllib/FixMyStreet/DB/Result/Body.pm b/perllib/FixMyStreet/DB/Result/Body.pm
index e4725d141..73d763a6e 100644
--- a/perllib/FixMyStreet/DB/Result/Body.pm
+++ b/perllib/FixMyStreet/DB/Result/Body.pm
@@ -69,6 +69,10 @@ __PACKAGE__->has_many(
# Created by DBIx::Class::Schema::Loader v0.07017 @ 2012-12-14 09:23:59
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:tvTHtIa0GrtptadZYHEM1Q
+sub url {
+ my ( $self, $c ) = @_;
+ # XXX $areas_info was used here for Norway parent - needs body parents, I guess
+ return $c->uri_for( '/reports/' . $c->cobrand->short_name( $self ) );
+}
-# You can replace this text with custom code or comments, and it will be preserved on regeneration
1;
diff --git a/perllib/FixMyStreet/DB/Result/Problem.pm b/perllib/FixMyStreet/DB/Result/Problem.pm
index 2d65c8789..32bdcbb4f 100644
--- a/perllib/FixMyStreet/DB/Result/Problem.pm
+++ b/perllib/FixMyStreet/DB/Result/Problem.pm
@@ -561,9 +561,7 @@ sub body {
map {
my $name = $_->name;
if (mySociety::Config::get('AREA_LINKS_FROM_PROBLEMS')) {
- '<a href="'
- # XXX . $c->uri_for( '/reports/' . $c->cobrand->short_name( $areas_info->{$_} ) )
- . '">' . $name . '</a>';
+ '<a href="' . $_->url($c) . '">' . $name . '</a>';
} else {
$name;
}