SyncPropertyForm: re-add related fields

e6e51dc broke this, related fields like 'host' or 'zone' have no longer been
offered. This did not affect existing Sync Rule configurations

fixes #903
This commit is contained in:
Thomas Gelf 2017-04-21 15:03:43 +02:00
parent 1887780363
commit ddcaaa7bcf

View File

@ -295,9 +295,10 @@ class SyncPropertyForm extends DirectorObjectForm
// TODO: allow those fields, but munge them (store ids)
//if (preg_match('~_id$~', $prop)) continue;
if (substr($prop, -3) === '_id') {
$short = substr($prop, 0, -3);
if ($dummy instanceof IcingaObject) {
if ($dummy->hasRelation($prop)) {
$prop = substr($prop, 0, -3);
if ($dummy->hasRelation($short)) {
$prop = $short;
} else {
continue;
}