From dbfc99454293f66f9705e597c1fd9273baeb267a Mon Sep 17 00:00:00 2001 From: Nathan Gray Date: Tue, 15 Mar 2016 15:58:52 +0000 Subject: [PATCH] Enable importing to categories with comma in their name --- .../inc/class.importexport_import_csv.inc.php | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/importexport/inc/class.importexport_import_csv.inc.php b/importexport/inc/class.importexport_import_csv.inc.php index 6f1dd0d336..9c1d7c1018 100755 --- a/importexport/inc/class.importexport_import_csv.inc.php +++ b/importexport/inc/class.importexport_import_csv.inc.php @@ -484,12 +484,21 @@ class importexport_import_csv implements importexport_iface_import_record { //, if($appname) { $GLOBALS['egw_info']['flags']['currentapp'] = $appname; } + $categories = new categories('',$appname); foreach((array)$fields['select-cat'] as $name) { if($record[$name]) { // Only parse name if it needs it if($format == 1) { - $cat_id = importexport_helper_functions::cat_name2id($record[$name]); + $existing_cat = $categories->exists('all',$record[$name]); + if($existing_cat) + { + $cat_id = $existing_cat; + } + else + { + $cat_id = importexport_helper_functions::cat_name2id($record[$name]); + } // Don't clear it if it wasn't found if($cat_id) $record[$name] = $cat_id; }