SyncPropertyForm: choosing imports should not fail

...with no templates available
This commit is contained in:
Thomas Gelf 2016-04-01 09:47:15 +02:00
parent dc7f9ac039
commit 3d64550802
1 changed files with 4 additions and 1 deletions

View File

@ -75,7 +75,10 @@ class SyncPropertyForm extends DirectorObjectForm
if ($destination === 'import') { if ($destination === 'import') {
$funcTemplates = 'enum' . ucfirst($this->rule->object_type) . 'Templates'; $funcTemplates = 'enum' . ucfirst($this->rule->object_type) . 'Templates';
$templates = $this->db->$funcTemplates(); $templates = $this->db->$funcTemplates();
if (! empty($templates)) {
$templates = array_combine($templates, $templates); $templates = array_combine($templates, $templates);
}
$this->addElement('select', 'source_expression', array( $this->addElement('select', 'source_expression', array(
'label' => $this->translate('Template'), // Objecttype? 'label' => $this->translate('Template'), // Objecttype?
'multiOptions' => $this->optionalEnum($templates), 'multiOptions' => $this->optionalEnum($templates),