]> git.ipfire.org Git - thirdparty/bugzilla.git/commitdiff
Bug 1507867 - splinter review links in emails are missing host/scheme, rendering...
authorKohei Yoshino <kohei.yoshino@gmail.com>
Mon, 19 Nov 2018 17:38:46 +0000 (12:38 -0500)
committerGitHub <noreply@github.com>
Mon, 19 Nov 2018 17:38:46 +0000 (12:38 -0500)
extensions/Splinter/Extension.pm
extensions/Splinter/lib/Util.pm
extensions/Splinter/template/en/default/hook/request/email-after_summary.txt.tmpl

index eb2006f471618353a790a1104aa83fe09da0d9e8..33d5684f73b90189d4159dcf1f8f6a6430c7da22 100644 (file)
@@ -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 {
index bda355d06ba7cb41460b44c62fcfc46541f89f07..f91a7d4b5a14f773908aca28ff115c9fe4c6de6e 100644 (file)
@@ -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";
 }
index 159a63e3634e899f651a79bf7038edfa71079dd1..20a56dbaadadc14db9df0602078ceea2e8f678b6 100644 (file)
@@ -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 %]