From: Max Kanat-Alexander Date: Tue, 16 Aug 2011 00:48:26 +0000 (-0700) Subject: Bug 460074: Make post_bug.cgi use should_set for array fields, so they X-Git-Tag: bugzilla-4.2rc1~92 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=92944f05e0626b212a17c4a0641c78453805a4c3;p=thirdparty%2Fbugzilla.git 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 --- diff --git a/post_bug.cgi b/post_bug.cgi index 6d6ed746ca..6ca46fb3c1 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)]; } diff --git a/template/en/default/bug/create/create.html.tmpl b/template/en/default/bug/create/create.html.tmpl index 8604f08397..ee19ab5d65 100644 --- a/template/en/default/bug/create/create.html.tmpl +++ b/template/en/default/bug/create/create.html.tmpl @@ -665,6 +665,7 @@ TUI_hide_default('attachment_text_field');
+ [% FOREACH group = product.groups_available %]