mirror of
https://github.com/Icinga/icingaweb2-module-director.git
synced 2025-07-29 08:44:11 +02:00
IcingaObject: fix key handling for unresolved props
This commit is contained in:
parent
b3a44bd7dd
commit
f2d9e1a544
@ -186,13 +186,14 @@ abstract class IcingaObject extends DbObject implements IcingaConfigRenderer
|
||||
|
||||
protected function resolveUnresolvedRelatedProperty($name)
|
||||
{
|
||||
$class = $this->getRelationClass($name);
|
||||
$short = substr($name, 0, -3);
|
||||
$class = $this->getRelationClass($short);
|
||||
$object = $class::load(
|
||||
$this->unresolvedRelatedProperties[$name],
|
||||
$this->connection
|
||||
);
|
||||
|
||||
$this->$key = $object->id;
|
||||
$this->$name = $object->id;
|
||||
unset($this->unresolvedRelatedProperties[$name]);
|
||||
}
|
||||
|
||||
@ -235,8 +236,8 @@ abstract class IcingaObject extends DbObject implements IcingaConfigRenderer
|
||||
if (substr($key, -3) === '_id') {
|
||||
$short = substr($key, 0, -3);
|
||||
if ($this->hasRelation($short)) {
|
||||
if (array_key_exists($short, $this->unresolvedRelatedProperties)) {
|
||||
$this->resolveUnresolvedRelatedProperty($short);
|
||||
if (array_key_exists($key, $this->unresolvedRelatedProperties)) {
|
||||
$this->resolveUnresolvedRelatedProperty($key);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user