reverted: --- b/modules/options/src/Plugin/Field/FieldType/ListItemBase.php +++ a/modules/options/src/Plugin/Field/FieldType/ListItemBase.php @@ -78,18 +78,7 @@ * {@inheritdoc} */ public function isEmpty() { + return empty($this->value) && (string) $this->value !== '0'; - // Based on the PHP empty() function the value is not empty, so there's no need to continue. - if (!empty($this->value)) { - return FALSE; - } - // Type of list_boolean. - elseif (isset($this->type) && $this->type == 'list_boolean') { - return (string) $this->value === '0'; - } - // Other types. - else { - return (string) $this->value !== '0'; - } } /** only in patch2: unchanged: --- a/core/modules/options/src/Plugin/Field/FieldType/ListItemBase.php +++ b/core/modules/options/src/Plugin/Field/FieldType/ListItemBase.php @@ -78,7 +78,18 @@ public static function generateSampleValue(FieldDefinitionInterface $field_defin * {@inheritdoc} */ public function isEmpty() { - return empty($this->value) && (string) $this->value !== '0'; + // Based on the PHP empty() function the value is not empty, so there's no need to continue. + if(!empty($this->value)) { + return FALSE; + } + // Type of list_boolean + elseif (isset($this->type) && $this->type == 'list_boolean') { + return (string) $this->value === '0'; + } + // Other types. + else { + return (string) $this->value !== '0'; + } } /**