summaryrefslogtreecommitdiffstats
path: root/Bugzilla/Template.pm
diff options
context:
space:
mode:
authorByron Jones <bjones@mozilla.com>2012-11-22 15:39:05 +0100
committerByron Jones <bjones@mozilla.com>2012-11-22 15:39:05 +0100
commit4c3e00573133dfc53d07805629af19599aaef7df (patch)
treee9ce090e958fb60edee1656af12fa414ba79efc3 /Bugzilla/Template.pm
parentda12cec61f8c7e667b00fc5fc39c827d3593f021 (diff)
downloadbugzilla-4c3e00573133dfc53d07805629af19599aaef7df.tar.gz
bugzilla-4c3e00573133dfc53d07805629af19599aaef7df.tar.xz
Bug 811280: Adds a caching mechanism to Bugzilla::Object to avoid querying the database repeatedly for the same information
r=dkl,a=LpSolit
Diffstat (limited to 'Bugzilla/Template.pm')
-rw-r--r--Bugzilla/Template.pm6
1 files changed, 3 insertions, 3 deletions
diff --git a/Bugzilla/Template.pm b/Bugzilla/Template.pm
index e13efec2b..f62a7c498 100644
--- a/Bugzilla/Template.pm
+++ b/Bugzilla/Template.pm
@@ -284,7 +284,7 @@ sub get_attachment_link {
my $dbh = Bugzilla->dbh;
$user ||= Bugzilla->user;
- my $attachment = new Bugzilla::Attachment($attachid);
+ my $attachment = new Bugzilla::Attachment({ id => $attachid, cache => 1 });
if ($attachment) {
my $title = "";
@@ -334,10 +334,10 @@ sub get_bug_link {
$options->{user} ||= Bugzilla->user;
my $dbh = Bugzilla->dbh;
- if (defined $bug) {
+ if (defined $bug && $bug ne '') {
if (!blessed($bug)) {
require Bugzilla::Bug;
- $bug = new Bugzilla::Bug($bug);
+ $bug = new Bugzilla::Bug({ id => $bug, cache => 1 });
}
return $link_text if $bug->{error};
}