summaryrefslogtreecommitdiffstats
path: root/Bugzilla/Template.pm
diff options
context:
space:
mode:
authorFrédéric Buclin <LpSolit@gmail.com>2012-02-29 17:15:57 +0100
committerFrédéric Buclin <LpSolit@gmail.com>2012-02-29 17:15:57 +0100
commit2e3a5735240ad3bc777e245bf1ce1505e3579fda (patch)
treed3f4df1d86913127422de7bc84a74912e72166c8 /Bugzilla/Template.pm
parent2231368ed7461a3be4f802462628cb7b261f829c (diff)
downloadbugzilla-2e3a5735240ad3bc777e245bf1ce1505e3579fda.tar.gz
bugzilla-2e3a5735240ad3bc777e245bf1ce1505e3579fda.tar.xz
Bug 731175: Bugzilla::Field shouldn't assume that someone else already loaded required modules
r=glob a=LpSolit
Diffstat (limited to 'Bugzilla/Template.pm')
-rw-r--r--Bugzilla/Template.pm8
1 files changed, 4 insertions, 4 deletions
diff --git a/Bugzilla/Template.pm b/Bugzilla/Template.pm
index c0c9b5db9..dcbe37b3f 100644
--- a/Bugzilla/Template.pm
+++ b/Bugzilla/Template.pm
@@ -10,7 +10,6 @@ package Bugzilla::Template;
use strict;
-use Bugzilla::Bug;
use Bugzilla::Constants;
use Bugzilla::WebService::Constants;
use Bugzilla::Hook;
@@ -19,10 +18,8 @@ use Bugzilla::Install::Util qw(install_string template_include_path
include_languages);
use Bugzilla::Keyword;
use Bugzilla::Util;
-use Bugzilla::User;
use Bugzilla::Error;
use Bugzilla::Search;
-use Bugzilla::Status;
use Bugzilla::Token;
use Cwd qw(abs_path);
@@ -315,7 +312,10 @@ sub get_bug_link {
my $dbh = Bugzilla->dbh;
if (defined $bug) {
- $bug = blessed($bug) ? $bug : new Bugzilla::Bug($bug);
+ if (!blessed($bug)) {
+ require Bugzilla::Bug;
+ $bug = new Bugzilla::Bug($bug);
+ }
return $link_text if $bug->{error};
}