From: Dylan Hardison Date: Fri, 26 Feb 2016 13:56:16 +0000 (-0500) Subject: Bug 1251221 - Pass cache => 1 to calls to Bugzilla::Product->new() called in Bugzilla... X-Git-Tag: release-5.1.1~67 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=c664718ef5e857144479859546d998f1465b830b;p=thirdparty%2Fbugzilla.git Bug 1251221 - Pass cache => 1 to calls to Bugzilla::Product->new() called in Bugzilla::{Milestone,Version,Component} r=dkl,a=dylan --- diff --git a/Bugzilla/Component.pm b/Bugzilla/Component.pm index 9bc0a44931..3e50dab80c 100644 --- a/Bugzilla/Component.pm +++ b/Bugzilla/Component.pm @@ -390,10 +390,9 @@ sub initial_cc { sub product { my $self = shift; - if (!defined $self->{'product'}) { - require Bugzilla::Product; # We cannot |use| it. - $self->{'product'} = new Bugzilla::Product($self->product_id); - } + + require Bugzilla::Product; + $self->{'product'} ||= Bugzilla::Product->new({ id => $self->product_id, cache => 1 }); return $self->{'product'}; } diff --git a/Bugzilla/Milestone.pm b/Bugzilla/Milestone.pm index cf7e3e35f1..9cee522488 100644 --- a/Bugzilla/Milestone.pm +++ b/Bugzilla/Milestone.pm @@ -236,7 +236,7 @@ sub product { my $self = shift; require Bugzilla::Product; - $self->{'product'} ||= new Bugzilla::Product($self->product_id); + $self->{'product'} ||= Bugzilla::Product->new({ id => $self->product_id, cache => 1 }); return $self->{'product'}; } diff --git a/Bugzilla/Version.pm b/Bugzilla/Version.pm index 4b332ff2bc..f6fedeba78 100644 --- a/Bugzilla/Version.pm +++ b/Bugzilla/Version.pm @@ -167,7 +167,7 @@ sub product { my $self = shift; require Bugzilla::Product; - $self->{'product'} ||= new Bugzilla::Product($self->product_id); + $self->{'product'} ||= Bugzilla::Product->new({ id => $self->product_id, cache => 1 }); return $self->{'product'}; }