From 5d52eaefd010ae9137543a9c7ae55b1261c575e3 Mon Sep 17 00:00:00 2001 From: Thomas Gelf Date: Mon, 11 Dec 2017 18:24:23 +0100 Subject: [PATCH] IcingaObject: check for modified properties... ...once again after resolving unresolved related properties. fixes #1315 --- library/Director/Objects/IcingaObject.php | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/library/Director/Objects/IcingaObject.php b/library/Director/Objects/IcingaObject.php index a4eecfc3..facfea54 100644 --- a/library/Director/Objects/IcingaObject.php +++ b/library/Director/Objects/IcingaObject.php @@ -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);