summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMax Kanat-Alexander <mkanat@bugzilla.org>2011-08-16 02:47:18 +0200
committerMax Kanat-Alexander <mkanat@bugzilla.org>2011-08-16 02:47:18 +0200
commit3a8142ae9f3cd14b6ca54c6db6f6f07fb9025fe8 (patch)
tree2242433ef67dfcc9229c744e8b1bcaf90697d39c
parent1a34c347b8b4977293fb55f5b7be344a607a3d85 (diff)
downloadbugzilla-3a8142ae9f3cd14b6ca54c6db6f6f07fb9025fe8.tar.gz
bugzilla-3a8142ae9f3cd14b6ca54c6db6f6f07fb9025fe8.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
-rwxr-xr-xpost_bug.cgi9
-rw-r--r--template/en/default/bug/create/create.html.tmpl1
2 files changed, 7 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)];
}
diff --git a/template/en/default/bug/create/create.html.tmpl b/template/en/default/bug/create/create.html.tmpl
index 8604f0839..ee19ab5d6 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');
<br>
<!-- Checkboxes -->
+ <input type="hidden" name="defined_groups" value="1">
[% FOREACH group = product.groups_available %]
<input type="checkbox" id="group_[% group.id FILTER html %]"
name="groups" value="[% group.name FILTER html %]"