]> git.ipfire.org Git - thirdparty/bugzilla.git/commitdiff
Bug 352695: Custom select fields are mandatory on bug creation (despite they shouldn...
authorolav%bkor.dhs.org <>
Sat, 21 Oct 2006 06:31:31 +0000 (06:31 +0000)
committerolav%bkor.dhs.org <>
Sat, 21 Oct 2006 06:31:31 +0000 (06:31 +0000)
Patch by Olav Vitters <olav@bkor.dhs.org> r=LpSolit a=myk

post_bug.cgi

index 59c0798970fd5b4644ff92d96a7783c0f487d9eb..715437141afd1f73e3f0df616a7f4790c6a6f7fc 100755 (executable)
@@ -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;