aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon Green <sgreen@redhat.com>2013-06-05 20:22:00 +0200
committerFrédéric Buclin <LpSolit@gmail.com>2013-06-05 20:22:00 +0200
commitdcec9de36e7a996bc841864071463bdee9067109 (patch)
tree05167dcf29dfd838b2bc25151af32d92ce042bad
parentBug 875744: Bug history messed up when two comments are made private (diff)
downloadbugzilla-dcec9de36e7a996bc841864071463bdee9067109.tar.gz
bugzilla-dcec9de36e7a996bc841864071463bdee9067109.tar.bz2
bugzilla-dcec9de36e7a996bc841864071463bdee9067109.zip
Bug 878623: Improvement in retrieving a classification name from bug
r=glob a=LpSolit
-rw-r--r--Bugzilla/Bug.pm10
1 files changed, 2 insertions, 8 deletions
diff --git a/Bugzilla/Bug.pm b/Bugzilla/Bug.pm
index 985978cb6..6eaed9357 100644
--- a/Bugzilla/Bug.pm
+++ b/Bugzilla/Bug.pm
@@ -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};
}