summaryrefslogtreecommitdiffstats
path: root/editparams.cgi
diff options
context:
space:
mode:
authorByron Jones <glob@mozilla.com>2015-08-11 17:16:38 +0200
committerByron Jones <glob@mozilla.com>2015-08-11 17:17:00 +0200
commit99bec2e52b174c1e8774ebf12da5963330d47af9 (patch)
treeee9f39a742eb6739be38355eac4af3399d17fb01 /editparams.cgi
parentdd7cd13b7cecaa92caebd3c4930154b2de35ff29 (diff)
downloadbugzilla-99bec2e52b174c1e8774ebf12da5963330d47af9.tar.gz
bugzilla-99bec2e52b174c1e8774ebf12da5963330d47af9.tar.xz
Bug 1160929 - add support for storing attachments in s3
Diffstat (limited to 'editparams.cgi')
-rwxr-xr-xeditparams.cgi32
1 files changed, 25 insertions, 7 deletions
diff --git a/editparams.cgi b/editparams.cgi
index 28aac9602..8eb117a26 100755
--- a/editparams.cgi
+++ b/editparams.cgi
@@ -61,13 +61,15 @@ my $param_panels = Bugzilla::Config::param_panels();
foreach my $panel (keys %$param_panels) {
my $module = $param_panels->{$panel};
eval("require $module") || die $@;
- my @module_param_list = "$module"->get_param_list();
- my $item = { name => lc($panel),
- current => ($current_panel eq lc($panel)) ? 1 : 0,
- param_list => \@module_param_list,
- sortkey => eval "\$${module}::sortkey;"
- };
- defined($item->{'sortkey'}) || ($item->{'sortkey'} = 100000);
+ my @module_param_list = $module->get_param_list();
+ my $item = {
+ name => lc($panel),
+ current => ($current_panel eq lc($panel)) ? 1 : 0,
+ param_list => \@module_param_list,
+ sortkey => eval "\$${module}::sortkey;",
+ module => $module,
+ };
+ $item->{sortkey} //= 100000;
push(@panels, $item);
$current_module = $panel if ($current_panel eq lc($panel));
}
@@ -84,6 +86,7 @@ if ($action eq 'save' && $current_module) {
my @changes = ();
my @module_param_list = @{ $hook_panels{lc($current_module)}->{params} };
+ my $any_changed = 0;
foreach my $i (@module_param_list) {
my $name = $i->{'name'};
my $value = $cgi->param($name);
@@ -151,6 +154,21 @@ if ($action eq 'save' && $current_module) {
if ($name eq 'duplicate_or_move_bug_status') {
Bugzilla::Status::add_missing_bug_status_transitions($value);
}
+ $any_changed = 1;
+ }
+ }
+
+ # allow panels to check inter-dependent params
+ if ($any_changed) {
+ foreach my $panel (@panels) {
+ next unless $panel->{name} eq lc($current_module);
+ my $module = $panel->{module};
+ next unless $module->can('check_params');
+ my $err = $module->check_params(Bugzilla->params);
+ if ($err ne '') {
+ ThrowUserError('invalid_parameters', { err => $err });
+ }
+ last;
}
}