summaryrefslogtreecommitdiffstats
path: root/Bugzilla/Field/Choice.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/Field/Choice.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/Field/Choice.pm')
-rw-r--r--Bugzilla/Field/Choice.pm6
1 files changed, 4 insertions, 2 deletions
diff --git a/Bugzilla/Field/Choice.pm b/Bugzilla/Field/Choice.pm
index b4666a27c..8c5873fdb 100644
--- a/Bugzilla/Field/Choice.pm
+++ b/Bugzilla/Field/Choice.pm
@@ -76,8 +76,10 @@ sub type {
my $field_obj = blessed $field ? $field : Bugzilla::Field->check($field);
my $field_name = $field_obj->name;
- if ($class->CLASS_MAP->{$field_name}) {
- return $class->CLASS_MAP->{$field_name};
+ if (my $package = $class->CLASS_MAP->{$field_name}) {
+ # Callers expect the module to be already loaded.
+ eval "require $package";
+ return $package;
}
# For generic classes, we use a lowercase class name, so as