From: Kohei Yoshino Date: Wed, 3 Apr 2019 20:53:20 +0000 (-0400) Subject: Bug 1071066 - For bugs with aliases, inline history displays the bug number rather... X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=a206a5b085f3aaf6d41680a39ca3ff45070fc3ae;p=thirdparty%2Fbugzilla.git Bug 1071066 - For bugs with aliases, inline history displays the bug number rather than the bug alias --- diff --git a/Bugzilla/Template.pm b/Bugzilla/Template.pm index 4db8085bf..0ce6acf95 100644 --- a/Bugzilla/Template.pm +++ b/Bugzilla/Template.pm @@ -771,11 +771,17 @@ sub create { 1 ], - bug_list_link => sub { - my ($buglist, $options) = @_; - return - join(", ", map(get_bug_link($_, $_, $options), split(/ *, */, $buglist))); - }, + bug_list_link => [ + sub { + my ($context, $options) = @_; + return sub { + my $buglist = shift; + return join(", ", + map { get_bug_link($_, $_, $options) } split(/\s*,\s*/, $buglist)); + }; + }, + 1 + ], # In CSV, quotes are doubled, and any value containing a quote or a # comma is enclosed in quotes. diff --git a/extensions/BugModal/template/en/default/bug_modal/activity_stream.html.tmpl b/extensions/BugModal/template/en/default/bug_modal/activity_stream.html.tmpl index fb2391c39..7d470e107 100644 --- a/extensions/BugModal/template/en/default/bug_modal/activity_stream.html.tmpl +++ b/extensions/BugModal/template/en/default/bug_modal/activity_stream.html.tmpl @@ -401,7 +401,7 @@ CASE 'see_also'; FOREACH see_also IN value; IF see_also.bug_id; - "$terms.bug $see_also.bug_id" FILTER bug_link(see_also.bug_id); + see_also.bug_id FILTER bug_link(see_also.bug_id, use_alias => 1); ELSE; %] [% see_also.url FILTER html %] @@ -433,7 +433,7 @@ INCLUDE bug_modal/rel_time.html.tmpl ts=value; ELSIF change.buglist; - value FILTER bug_list_link; + value FILTER bug_list_link(use_alias => 1); ELSIF change.fieldname.match('^cf_(status|tracking)_') && value != '---'; %] diff --git a/template/en/default/bug/activity/table.html.tmpl b/template/en/default/bug/activity/table.html.tmpl index 97683590b..55f766889 100644 --- a/template/en/default/bug/activity/table.html.tmpl +++ b/template/en/default/bug/activity/table.html.tmpl @@ -104,7 +104,16 @@ change.fieldname == 'dependson' || change.fieldname == 'regresses' || change.fieldname == 'regressed_by' %] - [% change_type FILTER bug_list_link FILTER none %] + [% change_type FILTER bug_list_link(use_alias => 1) FILTER none %] + [% ELSIF change.fieldname == 'see_also' %] + [% FOREACH url IN change_type.split(', ') %] + [% IF (matches = url.match("^${urlbase}show_bug\\.cgi\\?id=(\\d+)$")) %] + [% matches.0 FILTER bug_link(matches.0, use_alias => 1) FILTER none %] + [% ELSE %] + [% display_value(change.fieldname, url) FILTER html %] + [% END %] + [% ', ' UNLESS loop.last %] + [% END %] [% ELSIF change.fieldname == 'assigned_to' || change.fieldname == 'reporter' || change.fieldname == 'qa_contact' ||