summaryrefslogtreecommitdiffstats
path: root/post_bug.cgi
diff options
context:
space:
mode:
authorMax Kanat-Alexander <mkanat@bugzilla.org>2011-08-16 02:48:26 +0200
committerMax Kanat-Alexander <mkanat@bugzilla.org>2011-08-16 02:48:26 +0200
commit92944f05e0626b212a17c4a0641c78453805a4c3 (patch)
treeb64449fbe548953c77d418000a2cf2e44c02e249 /post_bug.cgi
parent63efc1fab453cd0c035890dd0641e90e581f6fb4 (diff)
downloadbugzilla-92944f05e0626b212a17c4a0641c78453805a4c3.tar.gz
bugzilla-92944f05e0626b212a17c4a0641c78453805a4c3.tar.xz
Bug 460074: Make post_bug.cgi use should_set for array fields, so they
are undef in Bugzilla::Bug->create if not passed to post_bug. This fixes a bug with the guided bug form creating bugs without any groups. r=LpSolit, a=mkanat
Diffstat (limited to 'post_bug.cgi')
-rwxr-xr-xpost_bug.cgi9
1 files changed, 6 insertions, 3 deletions
diff --git a/post_bug.cgi b/post_bug.cgi
index 6d6ed746c..6ca46fb3c 100755
--- a/post_bug.cgi
+++ b/post_bug.cgi
@@ -153,14 +153,17 @@ my %bug_params;
foreach my $field (@bug_fields) {
$bug_params{$field} = $cgi->param($field);
}
-$bug_params{'cc'} = [$cgi->param('cc')];
-$bug_params{'groups'} = [$cgi->param('groups')];
-$bug_params{'comment'} = $comment;
+foreach my $field (qw(cc groups)) {
+ next if !$cgi->should_set($field);
+ $bug_params{$field} = [$cgi->param($field)];
+}
+$bug_params{'comment'} = $comment;
my @multi_selects = grep {$_->type == FIELD_TYPE_MULTI_SELECT && $_->enter_bug}
Bugzilla->active_custom_fields;
foreach my $field (@multi_selects) {
+ next if !$cgi->should_set($field->name);
$bug_params{$field->name} = [$cgi->param($field->name)];
}