IcingaObject: check for modified properties...

...once again after resolving unresolved related properties.

fixes #1315
This commit is contained in:
Thomas Gelf 2017-12-11 18:24:23 +01:00
parent 13eac58290
commit 5d52eaefd0
1 changed files with 14 additions and 1 deletions

View File

@ -512,7 +512,15 @@ abstract class IcingaObject extends DbObject implements IcingaConfigRenderer
if (parent::hasBeenModified()) {
return true;
}
$this->resolveUnresolvedRelatedProperties();
if ($this->hasUnresolvedRelatedProperties()) {
$this->resolveUnresolvedRelatedProperties();
// Duplicates above code, but this makes it faster:
if (parent::hasBeenModified()) {
return true;
}
}
if ($this->supportsCustomVars() && $this->vars !== null && $this->vars()->hasBeenModified()) {
return true;
@ -552,6 +560,11 @@ abstract class IcingaObject extends DbObject implements IcingaConfigRenderer
return false;
}
protected function hasUnresolvedRelatedProperties()
{
return ! empty($this->unresolvedRelatedProperties);
}
protected function hasUnresolvedRelatedProperty($name)
{
return array_key_exists($name, $this->unresolvedRelatedProperties);