mirror of
https://github.com/Icinga/icingaweb2.git
synced 2025-07-26 07:14:35 +02:00
parent
bd6e65374d
commit
9791e6ffb8
@ -58,7 +58,7 @@ class ConfigForm extends Form
|
|||||||
{
|
{
|
||||||
$sections = array();
|
$sections = array();
|
||||||
foreach ($this->getValues() as $sectionAndPropertyName => $value) {
|
foreach ($this->getValues() as $sectionAndPropertyName => $value) {
|
||||||
if ($value === '' || (is_array($value) && empty($value))) {
|
if ($value === '' || $value === false || $value === []) {
|
||||||
$value = null; // Causes the config writer to unset it
|
$value = null; // Causes the config writer to unset it
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -137,6 +137,8 @@ class ConfigForm extends Form
|
|||||||
*/
|
*/
|
||||||
public static function transformEmptyValuesToNull(array $values)
|
public static function transformEmptyValuesToNull(array $values)
|
||||||
{
|
{
|
||||||
return array_map(function ($v) { return ($v === '' || (is_array($v) && empty($v))) ? null : $v; }, $values);
|
return array_map(function ($v) {
|
||||||
|
return ($v === '' || $v === false || $v === []) ? null : $v;
|
||||||
|
}, $values);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user