Form/Element/Number: The field should be valid when empty

This commit is contained in:
Markus Frosch 2017-08-17 13:20:51 +02:00
parent b7639651e8
commit 1d06d4e3c4
1 changed files with 1 additions and 1 deletions

View File

@ -134,7 +134,7 @@ class Number extends FormElement
{
$this->setValue($value);
$value = $this->getValue();
if ($value !== '' && ! is_numeric($value)) {
if ($value !== null && $value !== '' && ! is_numeric($value)) {
$this->addError(sprintf(t('\'%s\' is not a valid number'), $value));
return false;
}