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
1 changed files with 9 additions and 7 deletions

View File

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