Skip to content

Commit 694b643

Browse files
RomainLvrRom1-B
andauthored
Fix - Validation for mandatory multiple dropdown (#937)
* Fix validation for mandatory multiple dropdown * Update CHANGELOG * Update inc/container.class.php Co-authored-by: Romain B. <8530352+Rom1-B@users.noreply.github.com> --------- Co-authored-by: Romain B. <8530352+Rom1-B@users.noreply.github.com>
1 parent c7dc7d0 commit 694b643

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
77

88
## [UNRELEASE]
99

10+
### Fixed
11+
12+
- Fix validation for mandatory multiple dropdown
13+
1014
## [1.21.21] - 2025-03-21
1115

1216
### Fixed

inc/container.class.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1521,8 +1521,7 @@ public static function validateValues($data, $itemtype, $massiveaction)
15211521
if (
15221522
$field['mandatory'] == 1
15231523
&& (
1524-
$value === null
1525-
|| $value === ''
1524+
empty($value)
15261525
|| (($field['type'] === 'dropdown' || preg_match('/^dropdown-.+/i', $field['type'])) && $value == 0)
15271526
|| (in_array($field['type'], ['date', 'datetime']) && $value == 'NULL')
15281527
)

0 commit comments

Comments
 (0)