IcingaObject: fix occasional error when showing...

...resolved properties for applied objects
This commit is contained in:
Thomas Gelf 2016-04-11 11:06:54 +02:00
parent 1a5aa87602
commit 46e230c5ad
1 changed files with 12 additions and 0 deletions

View File

@ -358,6 +358,18 @@ abstract class IcingaObject extends DbObject implements IcingaConfigRenderer
return parent::get($key);
}
public function setProperties($props)
{
if (is_array($props)) {
if (array_key_exists('object_type', $props) && key($props) !== 'object_type') {
$type = $props['object_type'];
unset($props['object_type']);
$props = array('object_type' => $type) + $props;
}
}
return parent::setProperties($props);
}
public function set($key, $value)
{
if ($key === 'vars') {