summaryrefslogtreecommitdiffstats
path: root/Bugzilla
diff options
context:
space:
mode:
authormkanat%bugzilla.org <>2006-07-04 06:23:25 +0200
committermkanat%bugzilla.org <>2006-07-04 06:23:25 +0200
commit49979b3775108f709cefbc9190eb9c7546aace94 (patch)
tree3947a3d223fdc9ab83df37783475b209b6edf4e7 /Bugzilla
parent089556aa0283a18568c2e71d154e1bc19c8b60d2 (diff)
downloadbugzilla-49979b3775108f709cefbc9190eb9c7546aace94.tar.gz
bugzilla-49979b3775108f709cefbc9190eb9c7546aace94.tar.xz
Bug 343112: @Bugzilla::Config::parampanels is only defined if something calls _load_params
Patch By Max Kanat-Alexander <mkanat@bugzilla.org> r=LpSolit, a=justdave
Diffstat (limited to 'Bugzilla')
-rw-r--r--Bugzilla/Config.pm25
1 files changed, 14 insertions, 11 deletions
diff --git a/Bugzilla/Config.pm b/Bugzilla/Config.pm
index 0e0c9d4e2..53e8b1b77 100644
--- a/Bugzilla/Config.pm
+++ b/Bugzilla/Config.pm
@@ -35,8 +35,6 @@ use strict;
use base qw(Exporter);
use Bugzilla::Constants;
-our @parampanels = ();
-
# Module stuff
@Bugzilla::Config::EXPORT = qw(Param);
@@ -48,9 +46,8 @@ our @parampanels = ();
admin => [qw(UpdateParams SetParam WriteParams)],
db => [qw($db_driver $db_host $db_port $db_name $db_user $db_pass $db_sock)],
localconfig => [qw($cvsbin $interdiffbin $diffpath $webservergroup)],
- params => [qw(@parampanels)],
);
-Exporter::export_ok_tags('admin', 'db', 'localconfig', 'params');
+Exporter::export_ok_tags('admin', 'db', 'localconfig');
use vars qw(@param_list);
@@ -71,17 +68,12 @@ do $localconfig;
my %params;
# Load in the param definitions
sub _load_params {
- my $libpath = bz_locations()->{'libpath'};
- foreach my $item ((glob "$libpath/Bugzilla/Config/*.pm")) {
- $item =~ m#/([^/]+)\.pm$#;
- my $module = $1;
- next if ($module eq 'Common');
- require "Bugzilla/Config/$module.pm";
+ foreach my $module (param_panels()) {
+ eval("require Bugzilla::Config::$module") || die $@;
my @new_param_list = "Bugzilla::Config::$module"->get_param_list();
foreach my $item (@new_param_list) {
$params{$item->{'name'}} = $item;
}
- push(@parampanels, $module);
push(@param_list, @new_param_list);
}
}
@@ -89,6 +81,17 @@ sub _load_params {
# Subroutines go here
+sub param_panels {
+ my @param_panels;
+ my $libpath = bz_locations()->{'libpath'};
+ foreach my $item ((glob "$libpath/Bugzilla/Config/*.pm")) {
+ $item =~ m#/([^/]+)\.pm$#;
+ my $module = $1;
+ push(@param_panels, $module) unless $module eq 'Common';
+ }
+ return @param_panels;
+}
+
sub Param {
my ($param) = @_;