# Current bug ID this comment belongs to
my $current_bugurl = $curr_bugid ? "show_bug.cgi?id=$curr_bugid" : "";
+ # This is a hack to speed up displaying comments for the Bugzilla 3.4
+ # branch.
+ my $word_cache = Bugzilla->request_cache->{template_get_text} ||= {};
+ Bugzilla->template_inner; # populates request_cache->{language}
+ my $lang = Bugzilla->request_cache->{language} || '';
+ my $bug_word = $word_cache->{$lang}->{bug}
+ ||= get_text('term', { term => 'bug' });
+
# This handles bug a, comment b type stuff. Because we're using /g
# we have to do this in one pattern, and so this is semi-messy.
# Also, we can't use $bug_re?$comment_re? because that will match the
# empty string
- my $bug_word = get_text('term', { term => 'bug' });
+
my $bug_re = qr/\Q$bug_word\E\s*\#?\s*(\d+)/i;
my $comment_re = qr/comment\s*\#?\s*(\d+)/i;
$text =~ s~\b($bug_re(?:\s*,?\s*$comment_re)?|$comment_re)
FROM bugs WHERE bugs.bug_id = ?',
undef, $bug_num);
+ # This is a hack to speed up displaying comments for the Bugzilla 3.4
+ # branch.
+ my $word_cache = Bugzilla->request_cache->{template_get_text} ||= {};
+ Bugzilla->template_inner; # populates request_cache->{language}
+ my $lang = Bugzilla->request_cache->{language} || '';
+
if ($bug_state) {
# Initialize these variables to be "" so that we don't get warnings
# if we don't change them below (which is highly likely).
my ($pre, $title, $post) = ("", "", "");
- $title = get_text('get_status', {status => $bug_state});
+ my $status = $word_cache->{$lang}->{status}->{$bug_state}
+ ||= get_text('get_status', {status => $bug_state});
+ $title = $status;
if ($bug_state eq 'UNCONFIRMED') {
$pre = "<i>";
$post = "</i>";
}
elsif (!is_open_state($bug_state)) {
$pre = '<span class="bz_closed">';
- $title .= ' ' . get_text('get_resolution', {resolution => $bug_res});
+ my $resolution = $word_cache->{$lang}->{resolution}->{$bug_res}
+ ||= get_text('get_resolution',
+ { resolution => $bug_res });
+ $title .= ' ' . $resolution;
$post = '</span>';
}
if (Bugzilla->user->can_see_bug($bug_num)) {
# already_wrapped: Determines whether the comment is pre-wrapped
#%]
-[% PROCESS 'global/field-descs.none.tmpl' %]
+[% PROCESS 'global/variables.none.tmpl' %]
[%- IF comment.type == constants.CMT_DUPE_OF -%]
X[% comment.body %]
[%+ terms.Bug %] moved to [% Param("move-to-url") %].
If the move succeeded, [% comment.extra_data %] will receive a mail containing
the number of the new [% terms.bug %] in the other database.
-If all went well, please mark this [% terms.bug %]
-[%+ get_status('VERIFIED') %], and paste in a link to the new [% terms.bug %].
+If all went well, please paste in a link to the new [% terms.bug %].
Otherwise, reopen this [% terms.bug %].
[%- ELSE -%]
X[%- comment.body %]