diff --git a/library/Director/Objects/IcingaArguments.php b/library/Director/Objects/IcingaArguments.php index 1492ecd8..e2115299 100644 --- a/library/Director/Objects/IcingaArguments.php +++ b/library/Director/Objects/IcingaArguments.php @@ -190,10 +190,14 @@ class IcingaArguments implements Iterator, Countable, IcingaConfigRenderer } } - if (array_key_exists('set_if', $attrs) && is_object($attrs['set_if'])) { - if ($attrs['set_if']->type === 'Function') { + if (array_key_exists('set_if', $attrs)) { + if (is_object($attrs['set_if']) && $attrs['set_if']->type === 'Function') { $attrs['set_if'] = '/* Unable to fetch function body through API */'; $attrs['set_if_format'] = 'expression'; + } elseif (property_exists($value, 'set_if_format')) { + if (in_array($value->set_if_format, ['string', 'expression', 'json'])) { + $attrs['set_if_format'] = $value->set_if_format; + } } }