From 318f85f651861ca9b12b5f96906d3094dce932d4 Mon Sep 17 00:00:00 2001 From: Klaus Leithoff Date: Tue, 29 May 2012 11:06:40 +0000 Subject: [PATCH] throw exception if there are no app profiles available for export --- importexport/inc/class.importexport_export_ui.inc.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/importexport/inc/class.importexport_export_ui.inc.php b/importexport/inc/class.importexport_export_ui.inc.php index a8d63d28a8..9f6a6f1162 100644 --- a/importexport/inc/class.importexport_export_ui.inc.php +++ b/importexport/inc/class.importexport_export_ui.inc.php @@ -218,7 +218,10 @@ class importexport_export_ui { $content['selection'] = $prefs['selection'] ? $prefs['selection'] : $selection; } unset ($plugin_object); - (array)$apps = importexport_helper_functions::get_apps('export'); + $apps = importexport_helper_functions::get_apps('export'); + //error_log(__METHOD__.__LINE__.array2string($apps)); + if (empty($apps)) throw new Exception('Error: no application profiles available for export'); + if (!is_array($apps) && $apps) $apps = (array)$apps; $sel_options['appname'] = array('' => lang('Select one')) + array_combine($apps,$apps); $this->js->set_onload("set_style_by_class('tr','select_plugin','display','none');"); if(!$_application && !$selected_plugin) {