summaryrefslogtreecommitdiffstats
path: root/Bugzilla/Template.pm
diff options
context:
space:
mode:
authorByron Jones <glob@mozilla.com>2014-07-07 10:01:17 +0200
committerByron Jones <glob@mozilla.com>2014-07-07 10:01:17 +0200
commit2721de5aa6b81e069a44b05e8b8e44c904928301 (patch)
tree619c827f18dd32efee485a1bd8b95055e58c8c1e /Bugzilla/Template.pm
parent3f631ad59df2f086e8d8343401ab27082cba5478 (diff)
downloadbugzilla-2721de5aa6b81e069a44b05e8b8e44c904928301.tar.gz
bugzilla-2721de5aa6b81e069a44b05e8b8e44c904928301.tar.xz
Bug 1033955: backport bug 1028795 to bmo (pre-load all related bugs during show_bug initialisation)
Diffstat (limited to 'Bugzilla/Template.pm')
-rw-r--r--Bugzilla/Template.pm9
1 files changed, 5 insertions, 4 deletions
diff --git a/Bugzilla/Template.pm b/Bugzilla/Template.pm
index b805a5a2c..057298b06 100644
--- a/Bugzilla/Template.pm
+++ b/Bugzilla/Template.pm
@@ -156,9 +156,10 @@ sub get_format {
# If you want to modify this routine, read the comments carefully
sub quoteUrls {
- my ($text, $bug, $comment, $user) = @_;
+ my ($text, $bug, $comment, $user, $bug_link_func) = @_;
return $text unless $text;
$user ||= Bugzilla->user;
+ $bug_link_func ||= \&get_bug_link;
# We use /g for speed, but uris can have other things inside them
# (http://foo/bug#3 for example). Filtering that out filters valid
@@ -212,7 +213,7 @@ sub quoteUrls {
map { qr/$_/ } grep($_, Bugzilla->params->{'urlbase'},
Bugzilla->params->{'sslbase'})) . ')';
$text =~ s~\b(${urlbase_re}\Qshow_bug.cgi?id=\E([0-9]+)(\#c([0-9]+))?)\b
- ~($things[$count++] = get_bug_link($3, $1, { comment_num => $5, user => $user })) &&
+ ~($things[$count++] = $bug_link_func->($3, $1, { comment_num => $5, user => $user })) &&
("\x{FDD2}" . ($count-1) . "\x{FDD3}")
~egox;
@@ -259,7 +260,7 @@ sub quoteUrls {
$text =~ s~\b($bug_re(?:$s*,?$s*$comment_re)?|$comment_re)
~ # We have several choices. $1 here is the link, and $2-4 are set
# depending on which part matched
- (defined($2) ? get_bug_link($2, $1, { comment_num => $3, user => $user }) :
+ (defined($2) ? $bug_link_func->($2, $1, { comment_num => $3, user => $user }) :
"<a href=\"$current_bugurl#c$4\">$1</a>")
~egx;
@@ -268,7 +269,7 @@ sub quoteUrls {
$text =~ s~(?<=^\*\*\*\ This\ bug\ has\ been\ marked\ as\ a\ duplicate\ of\ )
(\d+)
(?=\ \*\*\*\Z)
- ~get_bug_link($1, $1, { user => $user })
+ ~$bug_link_func->($1, $1, { user => $user })
~egmx;
# Now remove the encoding hacks in reverse order