summaryrefslogtreecommitdiffstats
path: root/Bugzilla/Bug.pm
diff options
context:
space:
mode:
authorKoosha Khajeh Moogahi <koosha.khajeh@gmail.com>2012-06-09 00:14:36 +0200
committerFrédéric Buclin <LpSolit@gmail.com>2012-06-09 00:14:36 +0200
commit15659830af72401bb709779eb1888fa34fa823a3 (patch)
treeb68db59d9b7ffda40e8e65edf5b00d66b68c8cdf /Bugzilla/Bug.pm
parent4a73f6aa87301ae6df3b0360043cc23301e1f68f (diff)
downloadbugzilla-15659830af72401bb709779eb1888fa34fa823a3.tar.gz
bugzilla-15659830af72401bb709779eb1888fa34fa823a3.tar.xz
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
Diffstat (limited to 'Bugzilla/Bug.pm')
-rw-r--r--Bugzilla/Bug.pm6
1 files changed, 6 insertions, 0 deletions
diff --git a/Bugzilla/Bug.pm b/Bugzilla/Bug.pm
index 90211efcf..1bf5a11cd 100644
--- a/Bugzilla/Bug.pm
+++ b/Bugzilla/Bug.pm
@@ -1920,6 +1920,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);
}