IcingaObject: do not clear imports on merge...
...when merged object has no imports
This commit is contained in:
parent
c0a08584ef
commit
6d562eef12
|
@ -2411,6 +2411,11 @@ abstract class IcingaObject extends DbObject implements IcingaConfigRenderer
|
|||
$object->set('groups', []);
|
||||
}
|
||||
|
||||
if ($object->supportsImports()) {
|
||||
$imports = $object->listImportNames();
|
||||
$object->set('imports', []);
|
||||
}
|
||||
|
||||
$plain = (array) $object->toPlainObject(false, false);
|
||||
unset($plain['vars']);
|
||||
unset($plain['groups']);
|
||||
|
@ -2441,6 +2446,12 @@ abstract class IcingaObject extends DbObject implements IcingaConfigRenderer
|
|||
}
|
||||
}
|
||||
|
||||
if ($object->supportsImports()) {
|
||||
if (! empty($imports)) {
|
||||
$this->set('imports', $imports);
|
||||
}
|
||||
}
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue