IcingaObject: fix unmodified multi rel properties

Former object in activity log used to be buggy in case you removed
all relations of a multi-relation properties
This commit is contained in:
Thomas Gelf 2016-03-17 08:27:11 +01:00
parent a7e1633b3f
commit 7546a9db66
1 changed files with 7 additions and 2 deletions

View File

@ -932,6 +932,10 @@ abstract class IcingaObject extends DbObject implements IcingaConfigRenderer
return true;
}
if ($this->propertyIsMultiRelation($key)) {
return true;
}
return parent::hasProperty($key);
}
@ -1663,8 +1667,9 @@ abstract class IcingaObject extends DbObject implements IcingaConfigRenderer
}
foreach ($this->loadAllMultiRelations() as $key => $rel) {
if (count($rel)) {
$props[$key] = $rel->listOriginalNames();
$old = $rel->listOriginalNames();
if (! empty($old)) {
$props[$key] = $old;
}
}