From 8e7b912e4c1e21fe7b62820c1119b213ad1410e0 Mon Sep 17 00:00:00 2001 From: "olav%bkor.dhs.org" Date: Fri, 20 Oct 2006 23:31:31 +0000 Subject: [PATCH] Bug 352695: Custom select fields are mandatory on bug creation (despite they shouldn't be) Patch by Olav Vitters r=LpSolit a=myk git-svn-id: svn://10.0.0.236/trunk@213943 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/webtools/bugzilla/post_bug.cgi | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/mozilla/webtools/bugzilla/post_bug.cgi b/mozilla/webtools/bugzilla/post_bug.cgi index 59c0798970f..715437141af 100755 --- a/mozilla/webtools/bugzilla/post_bug.cgi +++ b/mozilla/webtools/bugzilla/post_bug.cgi @@ -123,7 +123,10 @@ $template->process($format->{'template'}, $vars, \$comment) my @custom_bug_fields = Bugzilla->get_fields( { custom => 1, obsolete => 0, enter_bug => 1 }); -my @bug_fields = map { $_->name } @custom_bug_fields; +# Undefined custom fields are ignored to ensure they will get their default +# value (e.g. "---" for custom single select fields). +my @bug_fields = grep { defined $cgi->param($_->name) } @custom_bug_fields; +@bug_fields = map { $_->name } @bug_fields; # Custom tables must be locked (required when validating custom fields). my @custom_tables = grep { $_->type == FIELD_TYPE_SINGLE_SELECT } @custom_bug_fields;