]> git.ipfire.org Git - thirdparty/bugzilla.git/commitdiff
Bug 880113 - Use the cache for the product and component name
authorSimon Green <sgreen@redhat.com>
Thu, 25 Jul 2013 04:28:54 +0000 (14:28 +1000)
committerSimon Green <sgreen@redhat.com>
Thu, 25 Jul 2013 04:28:54 +0000 (14:28 +1000)
r=LpSolit, a=glob

Bugzilla/Bug.pm

index 40acca87184187e3b0e1118b5191f36bdac714c7..f27baa532d2c2e2d3d7d242c22635dd32c811f90 100644 (file)
@@ -3288,11 +3288,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};
 }
 
@@ -3492,11 +3489,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};
 }