Commit dcec9de3 authored by Simon Green's avatar Simon Green Committed by Frédéric Buclin

Bug 878623: Improvement in retrieving a classification name from bug

r=glob a=LpSolit
parent ed227115
...@@ -3308,21 +3308,15 @@ sub component_obj { ...@@ -3308,21 +3308,15 @@ sub component_obj {
sub classification_id { sub classification_id {
my ($self) = @_; my ($self) = @_;
return $self->{classification_id} if exists $self->{classification_id};
return 0 if $self->{error}; return 0 if $self->{error};
($self->{classification_id}) = Bugzilla->dbh->selectrow_array( $self->{classification_id} //= $self->product_obj->classification_id;
'SELECT classification_id FROM products WHERE id = ?',
undef, $self->{product_id});
return $self->{classification_id}; return $self->{classification_id};
} }
sub classification { sub classification {
my ($self) = @_; my ($self) = @_;
return $self->{classification} if exists $self->{classification};
return '' if $self->{error}; return '' if $self->{error};
($self->{classification}) = Bugzilla->dbh->selectrow_array( $self->{classification} //= $self->product_obj->classification->name;
'SELECT name FROM classifications WHERE id = ?',
undef, $self->classification_id);
return $self->{classification}; return $self->{classification};
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment