diff options
Diffstat (limited to 'Bugzilla/Component.pm')
-rw-r--r-- | Bugzilla/Component.pm | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/Bugzilla/Component.pm b/Bugzilla/Component.pm index dc3cc1b9e..0fe6fb25a 100644 --- a/Bugzilla/Component.pm +++ b/Bugzilla/Component.pm @@ -352,30 +352,30 @@ sub bug_ids { sub default_assignee { my $self = shift; - - if (!defined $self->{'default_assignee'}) { - $self->{'default_assignee'} = - new Bugzilla::User($self->{'initialowner'}); - } - return $self->{'default_assignee'}; + return $self->{'default_assignee'} + ||= new Bugzilla::User({ id => $self->{'initialowner'}, cache => 1 }); } sub default_qa_contact { my $self = shift; if (!defined $self->{'default_qa_contact'}) { - $self->{'default_qa_contact'} = - new Bugzilla::User($self->{'initialqacontact'}); + my $params = $self->{'initialqacontact'} + ? { id => $self->{'initialqacontact'}, cache => 1 } + : $self->{'initialqacontact'}; + $self->{'default_qa_contact'} = new Bugzilla::User($params); } return $self->{'default_qa_contact'}; } sub flag_types { - my $self = shift; + my ($self, $params) = @_; + $params ||= {}; if (!defined $self->{'flag_types'}) { my $flagtypes = Bugzilla::FlagType::match({ product_id => $self->product_id, - component_id => $self->id }); + component_id => $self->id, + %$params }); $self->{'flag_types'} = {}; $self->{'flag_types'}->{'bug'} = |