From 03a5708a008a80bee375533684fce27e3c8ef460 Mon Sep 17 00:00:00 2001 From: Thomas Gelf Date: Wed, 16 Mar 2016 21:34:46 +0100 Subject: [PATCH] IcingaObject: return booleans in plain objects --- library/Director/Objects/IcingaObject.php | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/library/Director/Objects/IcingaObject.php b/library/Director/Objects/IcingaObject.php index a0386a4e..4e6061a6 100644 --- a/library/Director/Objects/IcingaObject.php +++ b/library/Director/Objects/IcingaObject.php @@ -1472,7 +1472,18 @@ abstract class IcingaObject extends DbObject implements IcingaConfigRenderer // TODO: Do not ship null properties based on flag? if (!$skipDefaults || $this->differsFromDefaultValue($k, $v)) { - $props[$k] = $v; + if ($k === 'disabled' || $this->propertyIsBoolean($k)) { + if ($v === 'y') { + $props[$k] = true; + } elseif ($v === 'n') { + $props[$k] = false; + } else { + $props[$k] = $v; + } + + } else { + $props[$k] = $v; + } } }