Fix selects without empty_label were not allowed to be empty in some cases, even without required=true

For example select-account multiple=true, or customfield select-account with rows > 1 would give error "'' is NOT allowed ('not found')"
This commit is contained in:
nathan 2022-09-23 09:39:50 -06:00
parent d133683272
commit 00c9550465

View File

@ -171,7 +171,8 @@ class Select extends Etemplate\Widget
} }
$allowed = array_map('strval', $allowed); $allowed = array_map('strval', $allowed);
if (!$multiple || $this->attrs['multiple'] === "dynamic") $allowed[] = ''; // Add empty as an option, we check for required value later
$allowed[] = '';
foreach((array) $value as $val) foreach((array) $value as $val)
{ {