IcingaObject: accept 'disable' on merge()

fixes #1104
This commit is contained in:
Thomas Gelf 2017-08-24 16:35:09 +02:00
parent 94ac5054e4
commit f55a672d48

View File

@ -2444,7 +2444,16 @@ abstract class IcingaObject extends DbObject implements IcingaConfigRenderer
$object->set('vars', []);
}
$this->setProperties((array) $object->toPlainObject(null, true));
$plain = (array) $object->toPlainObject(null, false);
unset($plain['vars']);
foreach ($plain as $p => $v) {
if ($v === null) {
// We want default values, but no null values
continue;
}
$this->set($p, $v);
}
if ($object->supportsCustomVars()) {
$myVars = $this->vars();