SyncPropertyForm: non-Icinga objects should not fail

This commit is contained in:
Thomas Gelf 2016-02-17 22:23:52 +01:00
parent f03503492a
commit 215f42926f
1 changed files with 3 additions and 3 deletions

View File

@ -229,8 +229,8 @@ class SyncPropertyForm extends DirectorObjectForm
if ($dummy instanceof IcingaObject) { if ($dummy instanceof IcingaObject) {
if ($dummy->supportsCustomvars()) { if ($dummy->supportsCustomvars()) {
$special['vars.*'] = $this->translate('Custom variable (vars.)'); $special['vars.*'] = $this->translate('Custom variable (vars.)');
$special['vars'] = $this->translate('All custom variables (vars)'); $special['vars'] = $this->translate('All custom variables (vars)');
} }
if ($dummy->supportsImports()) { if ($dummy->supportsImports()) {
$special['import'] = $this->translate('Inheritance (import)'); $special['import'] = $this->translate('Inheritance (import)');
@ -250,7 +250,7 @@ class SyncPropertyForm extends DirectorObjectForm
//if (preg_match('~_id$~', $prop)) continue; //if (preg_match('~_id$~', $prop)) continue;
if (substr($prop, -3) === '_id') { if (substr($prop, -3) === '_id') {
$prop = substr($prop, 0, -3); $prop = substr($prop, 0, -3);
if (! $dummy->hasRelation($prop)) { if (! $dummy instanceof IcingaObject || ! $dummy->hasRelation($prop)) {
continue; continue;
} }
} }