mirror of
https://github.com/Icinga/icingaweb2.git
synced 2025-07-01 11:04:24 +02:00
Form/Element/Number: The field should be valid when empty
This commit is contained in:
parent
b7639651e8
commit
1d06d4e3c4
@ -134,7 +134,7 @@ class Number extends FormElement
|
|||||||
{
|
{
|
||||||
$this->setValue($value);
|
$this->setValue($value);
|
||||||
$value = $this->getValue();
|
$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));
|
$this->addError(sprintf(t('\'%s\' is not a valid number'), $value));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user