From 70f22ae49bfee300a79aece56ca72cb319b786a5 Mon Sep 17 00:00:00 2001 From: "dkl%redhat.com" <> Date: Wed, 28 Jan 2009 04:12:41 +0000 Subject: Bug 470262 - Show alias if available in show_bug.cgi for bug dependencies, otherwise show bug id Mistakenly checked in previous version of patch. This brings the changes up to date with the approved patch. dkl --- Bugzilla/Template.pm | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/Bugzilla/Template.pm b/Bugzilla/Template.pm index 4c5f05662..03a9df827 100644 --- a/Bugzilla/Template.pm +++ b/Bugzilla/Template.pm @@ -323,13 +323,13 @@ sub get_bug_link { my $quote_bug_num = html_quote($bug_num); detaint_natural($bug_num) || return "<invalid bug number: $quote_bug_num>"; - my $bug = Bugzilla::Bug->new($bug_num); - my $bug_state = $bug->bug_status; - my $bug_res = $bug->resolution; - my $bug_desc = $bug->short_desc; + my ($bug_alias, $bug_state, $bug_res, $bug_desc) = + $dbh->selectrow_array('SELECT bugs.alias, bugs.bug_status, bugs.resolution, bugs.short_desc + FROM bugs WHERE bugs.bug_id = ?', + undef, $bug_num); - if ($options->{use_alias} && $bug->alias) { - $link_text = $bug->alias; + if ($options->{use_alias} && $link_text =~ /^\d+$/ && $bug_alias) { + $link_text = $bug_alias; } if ($bug_state) { -- cgit v1.2.3-24-g4f1b