From 8acd06646ff55af4dca6e4aa61991165b94c3447 Mon Sep 17 00:00:00 2001 From: Ryan Cramer Date: Tue, 27 Feb 2018 10:36:05 -0500 Subject: [PATCH] Fix issue processwire/processwire-issues#349 InputfieldOptions with InputfieldSelect required field not having blank option --- wire/modules/Inputfield/InputfieldSelect.module | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/wire/modules/Inputfield/InputfieldSelect.module b/wire/modules/Inputfield/InputfieldSelect.module index 83731524..534835cf 100644 --- a/wire/modules/Inputfield/InputfieldSelect.module +++ b/wire/modules/Inputfield/InputfieldSelect.module @@ -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 .= ""; }