[icinga-checkins] icinga.org: icingaweb2-module-director/feature/test-runner-12905: IcingaObject: Allow replaceWith on non-apply Objects

git at icinga.org git at icinga.org
Wed Nov 2 19:31:03 CET 2016


Module: icingaweb2-module-director
Branch: feature/test-runner-12905
Commit: f9f61be7aa454afda474bd61969b6bb20ca2b031
URL:    https://git.icinga.org/?p=icingaweb2-module-director.git;a=commit;h=f9f61be7aa454afda474bd61969b6bb20ca2b031

Author: Markus Frosch <markus.frosch at icinga.com>
Date:   Thu Oct 27 15:39:39 2016 +0200

IcingaObject: Allow replaceWith on non-apply Objects

This broke with assign_filter changes, we should not throw an error when
the filter is actually null.

replaceWith() re-sets all vars.

refs #12033

---

 library/Director/Objects/IcingaObject.php |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/library/Director/Objects/IcingaObject.php b/library/Director/Objects/IcingaObject.php
index 438eceb..f0eb1b5 100644
--- a/library/Director/Objects/IcingaObject.php
+++ b/library/Director/Objects/IcingaObject.php
@@ -396,7 +396,7 @@ abstract class IcingaObject extends DbObject implements IcingaConfigRenderer
      */
     public function setAssign_filter($filter)
     {
-        if (! $this->supportsAssignments()) {
+        if (! $this->supportsAssignments() && $filter !== null) {
             if ($this->hasProperty('object_type')) {
                 $type = $this->object_type;
             } else {



More information about the icinga-checkins mailing list