From 215f42926fab2b7a095c6e87e554d928cb619087 Mon Sep 17 00:00:00 2001 From: Thomas Gelf Date: Wed, 17 Feb 2016 22:23:52 +0100 Subject: [PATCH] SyncPropertyForm: non-Icinga objects should not fail --- application/forms/SyncPropertyForm.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/application/forms/SyncPropertyForm.php b/application/forms/SyncPropertyForm.php index 473b6201..42b13859 100644 --- a/application/forms/SyncPropertyForm.php +++ b/application/forms/SyncPropertyForm.php @@ -229,8 +229,8 @@ class SyncPropertyForm extends DirectorObjectForm if ($dummy instanceof IcingaObject) { if ($dummy->supportsCustomvars()) { - $special['vars.*'] = $this->translate('Custom variable (vars.)'); - $special['vars'] = $this->translate('All custom variables (vars)'); + $special['vars.*'] = $this->translate('Custom variable (vars.)'); + $special['vars'] = $this->translate('All custom variables (vars)'); } if ($dummy->supportsImports()) { $special['import'] = $this->translate('Inheritance (import)'); @@ -250,7 +250,7 @@ class SyncPropertyForm extends DirectorObjectForm //if (preg_match('~_id$~', $prop)) continue; if (substr($prop, -3) === '_id') { $prop = substr($prop, 0, -3); - if (! $dummy->hasRelation($prop)) { + if (! $dummy instanceof IcingaObject || ! $dummy->hasRelation($prop)) { continue; } }