diff --git a/library/Director/Objects/IcingaObject.php b/library/Director/Objects/IcingaObject.php index 92b1cb88..580850fd 100644 --- a/library/Director/Objects/IcingaObject.php +++ b/library/Director/Objects/IcingaObject.php @@ -2176,6 +2176,19 @@ abstract class IcingaObject extends DbObject implements IcingaConfigRenderer return $out; } + /** + * @return string + */ + protected function renderLegacyMultiRelations() + { + $out = ''; + foreach ($this->loadAllMultiRelations() as $rel) { + $out .= $rel->toLegacyConfigString(); + } + + return $out; + } + /** * @return string */ @@ -2393,11 +2406,11 @@ abstract class IcingaObject extends DbObject implements IcingaConfigRenderer $this->renderLegacyObjectHeader(), $this->renderLegacyImports(), $this->renderLegacyProperties(), - $this->renderLegacyRanges(), //$this->renderArguments(), //$this->renderRelatedSets(), $this->renderLegacyGroups(), - //$this->renderMultiRelations(), + $this->renderLegacyMultiRelations(), + $this->renderLegacyRanges(), $this->renderLegacyCustomExtensions(), $this->renderLegacyCustomVars(), $this->renderLegacySuffix() @@ -2442,11 +2455,11 @@ abstract class IcingaObject extends DbObject implements IcingaConfigRenderer $this->renderPrioritizedProperties(), $this->renderImports(), $this->renderProperties(), - $this->renderRanges(), $this->renderArguments(), $this->renderRelatedSets(), $this->renderGroups(), $this->renderMultiRelations(), + $this->renderRanges(), $this->renderCustomExtensions(), $this->renderCustomVars(), $this->renderSuffix() diff --git a/library/Director/Objects/IcingaObjectMultiRelations.php b/library/Director/Objects/IcingaObjectMultiRelations.php index 87bc6617..2d36d9d1 100644 --- a/library/Director/Objects/IcingaObjectMultiRelations.php +++ b/library/Director/Objects/IcingaObjectMultiRelations.php @@ -30,6 +30,8 @@ class IcingaObjectMultiRelations implements Iterator, Countable, IcingaConfigRen protected $relatedShortName; + protected $legacyPropertyName; + private $position = 0; private $db; @@ -439,6 +441,11 @@ class IcingaObjectMultiRelations implements Iterator, Countable, IcingaConfigRen return ''; } - return c1::renderKeyValue($this->propertyName, c1::renderArray($relations)); + if ($this->legacyPropertyName === null) { + return ' # not supported in legacy: ' . + c1::renderKeyValue($this->propertyName, c1::renderArray($relations), ''); + } + + return c1::renderKeyValue($this->legacyPropertyName, c1::renderArray($relations)); } }