mirror of
https://github.com/processwire/processwire.git
synced 2025-08-16 19:54:24 +02:00
Fix issue processwire/processwire-issues#349 InputfieldOptions with InputfieldSelect required field not having blank option
This commit is contained in:
@@ -260,7 +260,8 @@ class InputfieldSelect extends Inputfield {
|
|||||||
reset($options);
|
reset($options);
|
||||||
$key = key($options);
|
$key = key($options);
|
||||||
$hasBlankOption = empty($key);
|
$hasBlankOption = empty($key);
|
||||||
if($allowBlank && !$this->required && !$this->attr('multiple') && !$hasBlankOption) {
|
if($allowBlank && !$hasBlankOption && !$this->attr('multiple')
|
||||||
|
&& (!$this->required || ($this->hasFieldtype == 'FieldtypeOptions' && !$this->attr('value')))) {
|
||||||
$out .= "<option value=''> </option>";
|
$out .= "<option value=''> </option>";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user