Import/Export - fix fatal error if definition is not selected, happened when only one definition was available.

This commit is contained in:
nathangray 2017-07-31 14:16:20 -06:00
parent 64a12f1ddd
commit ecea3d7e00
2 changed files with 5 additions and 1 deletions

View File

@ -99,6 +99,7 @@ class importexport_export_ui {
} }
if(count($sel_options['definition']) == 2 && !$content['definition']) { if(count($sel_options['definition']) == 2 && !$content['definition']) {
$content['definition'] = end($sel_options['definition']); $content['definition'] = end($sel_options['definition']);
unset($sel_options['definition']['']);
} }
unset($definitions); unset($definitions);
//$sel_options['definition']['expert'] = lang('Expert options'); //$sel_options['definition']['expert'] = lang('Expert options');

View File

@ -127,7 +127,10 @@ class importexport_widget_filter extends Etemplate\Widget\Transformer
} }
// We don't want the 'All' or 'Select...' if it's there // We don't want the 'All' or 'Select...' if it's there
unset($field['values']['']); if(is_array($field['values']) && $field['values'][''])
{
unset($field['values']['']);
}
$this->setElementAttribute($form_name.'['.self::$prefix.$lname.']', 'empty_label', ''); $this->setElementAttribute($form_name.'['.self::$prefix.$lname.']', 'empty_label', '');
$this->setElementAttribute($form_name.'['.self::$prefix.$lname.']', 'tags', TRUE); $this->setElementAttribute($form_name.'['.self::$prefix.$lname.']', 'tags', TRUE);
$this->setElementAttribute($form_name.'['.self::$prefix.$lname.']', 'multiple', TRUE); $this->setElementAttribute($form_name.'['.self::$prefix.$lname.']', 'multiple', TRUE);