From aa888f2218179d59b4f0b8e51e43b863f1da3e43 Mon Sep 17 00:00:00 2001 From: "mkanat%bugzilla.org" <> Date: Sat, 8 Sep 2007 05:14:25 +0000 Subject: Bug 287330: Multi-Select Custom Fields Patch By Max Kanat-Alexander r=LpSolit, a=LpSolit --- post_bug.cgi | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'post_bug.cgi') diff --git a/post_bug.cgi b/post_bug.cgi index b873d8f72..ddc12fd64 100755 --- a/post_bug.cgi +++ b/post_bug.cgi @@ -120,8 +120,8 @@ $template->process($format->{'template'}, $vars, \$comment) || ThrowTemplateError($template->error()); # Include custom fields editable on bug creation. -my @custom_bug_fields = Bugzilla->get_fields( - { custom => 1, obsolete => 0, enter_bug => 1 }); +my @custom_bug_fields = grep {$_->type != FIELD_TYPE_MULTI_SELECT} + Bugzilla->get_fields({ custom => 1, obsolete => 0, enter_bug => 1 }); # Undefined custom fields are ignored to ensure they will get their default # value (e.g. "---" for custom single select fields). @@ -167,6 +167,13 @@ $bug_params{'cc'} = [$cgi->param('cc')]; $bug_params{'groups'} = \@selected_groups; $bug_params{'comment'} = $comment; +my @multi_selects = Bugzilla->get_fields( + { type => FIELD_TYPE_MULTI_SELECT, custom => 1, obsolete => 0, + enter_bug => 1 }); +foreach my $field (@multi_selects) { + $bug_params{$field->name} = [$cgi->param($field->name)]; +} + my $bug = Bugzilla::Bug->create(\%bug_params); # Get the bug ID back. -- cgit v1.2.1