IcingaHostSelfServiceForm: ignore empty values

This commit is contained in:
Thomas Gelf 2019-12-04 12:26:37 +01:00
parent 3f657a01c8
commit e0c0662be1
2 changed files with 6 additions and 1 deletions

View File

@ -108,7 +108,9 @@ class IcingaHostSelfServiceForm extends DirectorForm
$propertyNames = ['display_name', 'address', 'address6'];
foreach ($propertyNames as $property) {
$host->set($property, $this->getValue($property));
if (\strlen($value = $this->getValue($property)) > 0) {
$host->set($property, $value);
}
}
} else {
$host = IcingaHost::create(array_filter($this->getValues(), 'strlen'), $db);

View File

@ -17,6 +17,9 @@ next (will be 1.8.0)
* FEATURE: Inspect is now available for Packages, Stages and Files (#1995)
* FEATURE: Allow to disable the Director frontend / UI (#2007)
### REST API
* FEATURE: Self Service API ignores empty/missing properties (e.g. no address)
1.7.2
-----