diff --git a/library/Director/Objects/IcingaObject.php b/library/Director/Objects/IcingaObject.php index 7c68d14f..438eceb7 100644 --- a/library/Director/Objects/IcingaObject.php +++ b/library/Director/Objects/IcingaObject.php @@ -1378,8 +1378,10 @@ abstract class IcingaObject extends DbObject implements IcingaConfigRenderer $config = new IcingaConfig($this->connection); $object = $this; if ($object->isExternal()) { - $object = clone($object); $object->object_type = 'object'; + $wasExternal = true; + } else { + $wasExternal = false; } try { @@ -1392,6 +1394,9 @@ abstract class IcingaObject extends DbObject implements IcingaConfigRenderer . '/* ' . $e->getMessage() . ' */' ); } + if ($wasExternal) { + $object->object_type = 'external_object'; + } return $config; }