From ecea3d7e007d621c6237f134246ac8b55af5c394 Mon Sep 17 00:00:00 2001 From: nathangray Date: Mon, 31 Jul 2017 14:16:20 -0600 Subject: [PATCH] Import/Export - fix fatal error if definition is not selected, happened when only one definition was available. --- importexport/inc/class.importexport_export_ui.inc.php | 1 + importexport/inc/class.importexport_widget_filter.inc.php | 5 ++++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/importexport/inc/class.importexport_export_ui.inc.php b/importexport/inc/class.importexport_export_ui.inc.php index a72822a623..ea52226c29 100644 --- a/importexport/inc/class.importexport_export_ui.inc.php +++ b/importexport/inc/class.importexport_export_ui.inc.php @@ -99,6 +99,7 @@ class importexport_export_ui { } if(count($sel_options['definition']) == 2 && !$content['definition']) { $content['definition'] = end($sel_options['definition']); + unset($sel_options['definition']['']); } unset($definitions); //$sel_options['definition']['expert'] = lang('Expert options'); diff --git a/importexport/inc/class.importexport_widget_filter.inc.php b/importexport/inc/class.importexport_widget_filter.inc.php index ce0246cea3..47ce3cc7ba 100644 --- a/importexport/inc/class.importexport_widget_filter.inc.php +++ b/importexport/inc/class.importexport_widget_filter.inc.php @@ -127,7 +127,10 @@ class importexport_widget_filter extends Etemplate\Widget\Transformer } // 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.']', 'tags', TRUE); $this->setElementAttribute($form_name.'['.self::$prefix.$lname.']', 'multiple', TRUE);