SyncPropertyForm: Only try to enum imports when we are able to

This allows a user to use fields or custom expression for serviceSet.

refs #12891
This commit is contained in:
Markus Frosch 2016-11-09 10:44:02 +01:00
parent 39538a3f33
commit 699b6a7293

View File

@ -160,14 +160,16 @@ class SyncPropertyForm extends DirectorObjectForm
if ($destination === 'import') { if ($destination === 'import') {
$funcTemplates = 'enum' . ucfirst($this->rule->get('object_type')) . 'Templates'; $funcTemplates = 'enum' . ucfirst($this->rule->get('object_type')) . 'Templates';
$templates = $this->db->$funcTemplates(); if (method_exists($this->db, $funcTemplates)) {
if (! empty($templates)) { $templates = $this->db->$funcTemplates();
$templates = array_combine($templates, $templates); if (! empty($templates)) {
} $templates = array_combine($templates, $templates);
}
$importTitle = $this->translate('Existing templates'); $importTitle = $this->translate('Existing templates');
$columns[$importTitle] = $templates; $columns[$importTitle] = $templates;
natsort($columns[$importTitle]); natsort($columns[$importTitle]);
}
} }
$xpTitle = $this->translate('Expert mode'); $xpTitle = $this->translate('Expert mode');