IcingaObject: do not unset unresolved related...

...properties, as long as they do not give us an object with an ID.
This is the case when adding new services to hosts which exist in a
branch only, and will no longer be a problem once our internal caches
work with UUIDs
This commit is contained in:
Thomas Gelf 2022-02-06 11:35:00 +01:00
parent 351c41cb3c
commit 324cc9ed5b

View File

@ -573,8 +573,12 @@ abstract class IcingaObject extends DbObject implements IcingaConfigRenderer
), $e->getCode(), $e);
}
$this->reallySet($name, $object->get('id'));
unset($this->unresolvedRelatedProperties[$name]);
$id = $object->get('id');
// Happens when load() get's a branched object, created in the branch
if ($id !== null) {
$this->reallySet($name, $id);
unset($this->unresolvedRelatedProperties[$name]);
}
}
/**