diff options
author | Hakim Cassimally <hakim@mysociety.org> | 2013-12-17 14:46:31 +0000 |
---|---|---|
committer | Hakim Cassimally <hakim@mysociety.org> | 2013-12-17 14:46:31 +0000 |
commit | c8447ee320407a0542106cf92d20d72b95452b19 (patch) | |
tree | fa620dcbbf935e2a740bf2f44ce36067da4f0298 /perllib/FixMyStreet/DB/ResultSet/Problem.pm | |
parent | cbfe33690c64f6a301e77971abb9b762318bb9be (diff) |
Test for admin_base_url in RS::Problem
Test that the slash is added in correct place (the base URL should not
have its own trailing slash).
Diffstat (limited to 'perllib/FixMyStreet/DB/ResultSet/Problem.pm')
-rw-r--r-- | perllib/FixMyStreet/DB/ResultSet/Problem.pm | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/perllib/FixMyStreet/DB/ResultSet/Problem.pm b/perllib/FixMyStreet/DB/ResultSet/Problem.pm index 603f425f7..3bf41035e 100644 --- a/perllib/FixMyStreet/DB/ResultSet/Problem.pm +++ b/perllib/FixMyStreet/DB/ResultSet/Problem.pm @@ -216,6 +216,11 @@ sub categories_summary { return \%categories; } +sub get_admin_url { + my ($rs, $cobrand, $row) = @_; + return $cobrand->admin_base_url . '/report_edit/' . $row->id; +} + sub send_reports { my ( $rs, $site_override ) = @_; @@ -278,7 +283,7 @@ sub send_reports { $h{query} = $row->postcode; $h{url} = $email_base_url . $row->url; - $h{admin_url} = $cobrand->admin_base_url . '/report_edit/' . $row->id; + $h{admin_url} = $rs->get_admin_url($cobrand, $row); $h{phone_line} = $h{phone} ? _('Phone:') . " $h{phone}\n\n" : ''; if ($row->photo) { $h{has_photo} = _("This web page also contains a photo of the problem, provided by the user.") . "\n\n"; |