diff --git a/CHANGELOG.md b/CHANGELOG.md index 1ea23464..cbab0fde 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](http://semver.org/). ## [UNRELEASE] +### Fixed + +- Fix validation for mandatory multiple dropdown + ## [1.21.21] - 2025-03-21 ### Fixed diff --git a/inc/container.class.php b/inc/container.class.php index 93c9de2c..d8cc983f 100644 --- a/inc/container.class.php +++ b/inc/container.class.php @@ -1521,8 +1521,7 @@ public static function validateValues($data, $itemtype, $massiveaction) if ( $field['mandatory'] == 1 && ( - $value === null - || $value === '' + empty($value) || (($field['type'] === 'dropdown' || preg_match('/^dropdown-.+/i', $field['type'])) && $value == 0) || (in_array($field['type'], ['date', 'datetime']) && $value == 'NULL') )