]> git.ipfire.org Git - thirdparty/bugzilla.git/commitdiff
Bug 878623: Improvement in retrieving a classification name from bug
authorSimon Green <sgreen@redhat.com>
Wed, 5 Jun 2013 18:22:00 +0000 (20:22 +0200)
committerFrédéric Buclin <LpSolit@gmail.com>
Wed, 5 Jun 2013 18:22:00 +0000 (20:22 +0200)
r=glob a=LpSolit

Bugzilla/Bug.pm

index 985978cb63c1cf80b2333617c46226d8d804bff3..6eaed9357eb7a208cd1fd7be448ba14aed1fc326 100644 (file)
@@ -3308,21 +3308,15 @@ sub component_obj {
 
 sub classification_id {
     my ($self) = @_;
-    return $self->{classification_id} if exists $self->{classification_id};
     return 0 if $self->{error};
-    ($self->{classification_id}) = Bugzilla->dbh->selectrow_array(
-        'SELECT classification_id FROM products WHERE id = ?',
-        undef, $self->{product_id});
+    $self->{classification_id} //= $self->product_obj->classification_id;
     return $self->{classification_id};
 }
 
 sub classification {
     my ($self) = @_;
-    return $self->{classification} if exists $self->{classification};
     return '' if $self->{error};
-    ($self->{classification}) = Bugzilla->dbh->selectrow_array(
-        'SELECT name FROM classifications WHERE id = ?',
-        undef, $self->classification_id);
+    $self->{classification} //= $self->product_obj->classification->name;
     return $self->{classification};
 }