summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSimon Green <sgreen@redhat.com>2014-03-27 08:33:04 +0100
committerByron Jones <glob@mozilla.com>2014-03-27 08:33:04 +0100
commit07ae8250224ecb9b955e525d37d95388631b7e4a (patch)
tree65c7ee39cad8f38c929a7058346c75d553b6bc18
parent8ba59b5e888f16ccc74ab9aa5b52c4ec64700197 (diff)
downloadbugzilla-07ae8250224ecb9b955e525d37d95388631b7e4a.tar.gz
bugzilla-07ae8250224ecb9b955e525d37d95388631b7e4a.tar.xz
Bug 880113: Use the cache for the product and component name
-rw-r--r--Bugzilla/Bug.pm10
1 files changed, 2 insertions, 8 deletions
diff --git a/Bugzilla/Bug.pm b/Bugzilla/Bug.pm
index f19803e1c..c5125e18b 100644
--- a/Bugzilla/Bug.pm
+++ b/Bugzilla/Bug.pm
@@ -3354,11 +3354,8 @@ sub cc_users {
sub component {
my ($self) = @_;
- return $self->{component} if exists $self->{component};
return '' if $self->{error};
- ($self->{component}) = Bugzilla->dbh->selectrow_array(
- 'SELECT name FROM components WHERE id = ?',
- undef, $self->{component_id});
+ ($self->{component}) //= $self->component_obj->name;
return $self->{component};
}
@@ -3529,11 +3526,8 @@ sub percentage_complete {
sub product {
my ($self) = @_;
- return $self->{product} if exists $self->{product};
return '' if $self->{error};
- ($self->{product}) = Bugzilla->dbh->selectrow_array(
- 'SELECT name FROM products WHERE id = ?',
- undef, $self->{product_id});
+ ($self->{product}) //= $self->product_obj->name;
return $self->{product};
}