From: Koosha Khajeh Moogahi Date: Fri, 8 Jun 2012 22:16:16 +0000 (+0200) Subject: Bug 577014: [SINGLE|MULTIPLE]_SELECT custom fields with no new values, containing... X-Git-Tag: bugzilla-4.2.2~13 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=89b41766cc47e26c59bfd95e351ab7767c394ab9;p=thirdparty%2Fbugzilla.git Bug 577014: [SINGLE|MULTIPLE]_SELECT custom fields with no new values, containing only the default value '---' and marked as mandatory, blocks the user to update/create a bug r/a=LpSolit --- diff --git a/Bugzilla/Bug.pm b/Bugzilla/Bug.pm index a848c866b7..741475a741 100644 --- a/Bugzilla/Bug.pm +++ b/Bugzilla/Bug.pm @@ -1953,6 +1953,12 @@ sub _check_field_is_mandatory { return if !$field->is_visible_on_bug($params || $invocant); + return if ($field->type == FIELD_TYPE_SINGLE_SELECT + && scalar @{ get_legal_field_values($field->name) } == 1); + + return if ($field->type == FIELD_TYPE_MULTI_SELECT + && !scalar @{ get_legal_field_values($field->name) }); + if (ref($value) eq 'ARRAY') { $value = join('', @$value); }