mirror of
https://github.com/processwire/processwire.git
synced 2025-08-15 11:14:12 +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);
|
||||
$key = key($options);
|
||||
$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>";
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user