From: Kohei Yoshino Date: Mon, 19 Nov 2018 17:38:46 +0000 (-0500) Subject: Bug 1507867 - splinter review links in emails are missing host/scheme, rendering... X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=1d219725acfbbddbecd7368800dcd9686325606b;p=thirdparty%2Fbugzilla.git Bug 1507867 - splinter review links in emails are missing host/scheme, rendering them unusable --- diff --git a/extensions/Splinter/Extension.pm b/extensions/Splinter/Extension.pm index eb2006f47..33d5684f7 100644 --- a/extensions/Splinter/Extension.pm +++ b/extensions/Splinter/Extension.pm @@ -33,8 +33,8 @@ BEGIN { } sub _get_review_url { - my ($class, $bug_id, $attach_id) = @_; - return get_review_url(Bugzilla::Bug->check({ id => $bug_id, cache => 1 }), $attach_id); + my ($class, $bug_id, $attach_id, $use_abs_url) = @_; + return get_review_url(Bugzilla::Bug->check({ id => $bug_id, cache => 1 }), $attach_id, $use_abs_url); } sub page_before_template { diff --git a/extensions/Splinter/lib/Util.pm b/extensions/Splinter/lib/Util.pm index bda355d06..f91a7d4b5 100644 --- a/extensions/Splinter/lib/Util.pm +++ b/extensions/Splinter/lib/Util.pm @@ -86,17 +86,18 @@ sub attachment_id_is_patch { } sub get_review_base { + my $use_abs_url = shift // 0; my $base = Bugzilla->params->{'splinter_base'}; $base =~ s!/$!!; - my $basepath = Bugzilla->localconfig->{basepath}; + my $basepath = Bugzilla->localconfig->{$use_abs_url ? 'urlbase' : 'basepath'}; $basepath =~ s!/$!! if $base =~ "^/"; $base = $basepath . $base; return $base; } sub get_review_url { - my ($bug, $attach_id) = @_; - my $base = get_review_base(); + my ($bug, $attach_id, $use_abs_url) = @_; + my $base = get_review_base($use_abs_url); my $bug_id = $bug->id; return $base . ($base =~ /\?/ ? '&' : '?') . "bug=$bug_id&attachment=$attach_id"; } diff --git a/extensions/Splinter/template/en/default/hook/request/email-after_summary.txt.tmpl b/extensions/Splinter/template/en/default/hook/request/email-after_summary.txt.tmpl index 159a63e36..20a56dbaa 100644 --- a/extensions/Splinter/template/en/default/hook/request/email-after_summary.txt.tmpl +++ b/extensions/Splinter/template/en/default/hook/request/email-after_summary.txt.tmpl @@ -4,6 +4,6 @@ && attachment && attachment.ispatch %] Review -[%+ Bugzilla.splinter_review_url(bug.bug_id, attachment.id) FILTER none %] +[%+ Bugzilla.splinter_review_url(bug.bug_id, attachment.id, 1) FILTER none %] [%- END %]