summaryrefslogtreecommitdiffstats
path: root/Bugzilla/Bug.pm
diff options
context:
space:
mode:
authorDave Lawrence <dlawrence@mozilla.com>2013-07-10 19:37:55 +0200
committerDave Lawrence <dlawrence@mozilla.com>2013-07-10 19:37:55 +0200
commit41cbe22c70d6e0299eacc0a09b68b8d1a52c17a4 (patch)
treec8bb5a5c0b12293eaa00fcdf60515fe33ccc39cd /Bugzilla/Bug.pm
parentb1a8bc55f2b5822405866bf4419f6b9cb49dd503 (diff)
downloadbugzilla-41cbe22c70d6e0299eacc0a09b68b8d1a52c17a4.tar.gz
bugzilla-41cbe22c70d6e0299eacc0a09b68b8d1a52c17a4.tar.xz
Bug 822980 - backport bug 815532 to bmo (Bugzilla::User objects should be cached where appropriate)
r=glob
Diffstat (limited to 'Bugzilla/Bug.pm')
-rw-r--r--Bugzilla/Bug.pm11
1 files changed, 6 insertions, 5 deletions
diff --git a/Bugzilla/Bug.pm b/Bugzilla/Bug.pm
index 4dcb6fe6e..15272e542 100644
--- a/Bugzilla/Bug.pm
+++ b/Bugzilla/Bug.pm
@@ -3251,8 +3251,8 @@ sub assigned_to {
my ($self) = @_;
return $self->{'assigned_to_obj'} if exists $self->{'assigned_to_obj'};
$self->{'assigned_to'} = 0 if $self->{'error'};
- $self->{'assigned_to_obj'} ||= new Bugzilla::User($self->{'assigned_to'});
- return $self->{'assigned_to_obj'};
+ return $self->{'assigned_to_obj'}
+ = new Bugzilla::User({ id => $self->{'assigned_to'}, cache => 1 });
}
sub blocked {
@@ -3512,7 +3512,8 @@ sub qa_contact {
return undef if $self->{'error'};
if (Bugzilla->params->{'useqacontact'} && $self->{'qa_contact'}) {
- $self->{'qa_contact_obj'} = new Bugzilla::User($self->{'qa_contact'});
+ $self->{'qa_contact_obj'}
+ = new Bugzilla::User({ id => $self->{'qa_contact'}, cache => 1 });
} else {
# XXX - This is somewhat inconsistent with the assignee/reporter
# methods, which will return an empty User if they get a 0.
@@ -3526,8 +3527,8 @@ sub reporter {
my ($self) = @_;
return $self->{'reporter'} if exists $self->{'reporter'};
$self->{'reporter_id'} = 0 if $self->{'error'};
- $self->{'reporter'} = new Bugzilla::User($self->{'reporter_id'});
- return $self->{'reporter'};
+ return $self->{'reporter'}
+ = new Bugzilla::User({ id => $self->{'reporter_id'}, cache => 1 });
}
sub see_also {