From 1d06d4e3c43e08bc4be0155296b6a40bc5044d7b Mon Sep 17 00:00:00 2001 From: Markus Frosch Date: Thu, 17 Aug 2017 13:20:51 +0200 Subject: [PATCH] Form/Element/Number: The field should be valid when empty --- library/Icinga/Web/Form/Element/Number.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/library/Icinga/Web/Form/Element/Number.php b/library/Icinga/Web/Form/Element/Number.php index b8f532c6f..212c0ed1d 100644 --- a/library/Icinga/Web/Form/Element/Number.php +++ b/library/Icinga/Web/Form/Element/Number.php @@ -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; }