summaryrefslogtreecommitdiffstats
path: root/Bugzilla/Bug.pm
diff options
context:
space:
mode:
authorKoosha Khajeh Moogahi <koosha.khajeh@gmail.com>2012-09-19 21:11:15 +0200
committerFrédéric Buclin <LpSolit@gmail.com>2012-09-19 21:11:15 +0200
commitccf50a2c6a7765bdec9d8b738367f93be679798c (patch)
tree8e0dfdebcc0a343c47dfd7a88987ab3ebf319381 /Bugzilla/Bug.pm
parent968667bb92b2f2e93e5c1b32b1aae36bacaf6a07 (diff)
downloadbugzilla-ccf50a2c6a7765bdec9d8b738367f93be679798c.tar.gz
bugzilla-ccf50a2c6a7765bdec9d8b738367f93be679798c.tar.xz
Bug 445861: $component->default_qa_contact should not return the default user object when no default QA contact is defined
r/a=LpSolit
Diffstat (limited to 'Bugzilla/Bug.pm')
-rw-r--r--Bugzilla/Bug.pm11
1 files changed, 4 insertions, 7 deletions
diff --git a/Bugzilla/Bug.pm b/Bugzilla/Bug.pm
index f47ed81c9..8c4045c13 100644
--- a/Bugzilla/Bug.pm
+++ b/Bugzilla/Bug.pm
@@ -1686,7 +1686,6 @@ sub _check_qa_contact {
$qa_contact = trim($qa_contact) if !ref $qa_contact;
my $component = blessed($invocant) ? $invocant->component_obj
: $params->{component};
- my $id;
if (!ref $invocant) {
# Bugs get no QA Contact on creation if useqacontact is off.
return undef if !Bugzilla->params->{useqacontact};
@@ -1695,13 +1694,14 @@ sub _check_qa_contact {
if (!Bugzilla->user->in_group('editbugs', $component->product_id)
|| !$qa_contact)
{
- $id = $component->default_qa_contact->id;
+ return $component->default_qa_contact ? $component->default_qa_contact->id : undef;
}
}
-
+
# If a QA Contact was specified or if we're updating, check
# the QA Contact for validity.
- if (!defined $id && $qa_contact) {
+ my $id;
+ if ($qa_contact) {
$qa_contact = Bugzilla::User->check($qa_contact) if !ref $qa_contact;
$id = $qa_contact->id;
# create() checks this another way, so we don't have to run this
@@ -3419,9 +3419,6 @@ sub qa_contact {
if (Bugzilla->params->{'useqacontact'} && $self->{'qa_contact'}) {
$self->{'qa_contact_obj'} = new Bugzilla::User($self->{'qa_contact'});
} else {
- # XXX - This is somewhat inconsistent with the assignee/reporter
- # methods, which will return an empty User if they get a 0.
- # However, we're keeping it this way now, for backwards-compatibility.
$self->{'qa_contact_obj'} = undef;
}
return $self->{'qa_contact_obj'};