From: VanagaS Date: Mon, 19 Sep 2016 15:02:49 +0000 (+0530) Subject: CRM-19192 - Event participant (and possibly other entity) imports do not handle ... X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=e6859ac58675126f606872cf2379b3eaf35a94a0;p=civicrm-core.git CRM-19192 - Event participant (and possibly other entity) imports do not handle "non-comma CSV" The default field separator (delimitor) present is config ($config->fieldSeparator | CRM_Core_Config) and this was used without considering the delimitor presented via the screen. This fix addresses this issue. --- diff --git a/CRM/Event/Import/Form/MapField.php b/CRM/Event/Import/Form/MapField.php index a94c0be47c..d7fab0ec8c 100644 --- a/CRM/Event/Import/Form/MapField.php +++ b/CRM/Event/Import/Form/MapField.php @@ -411,9 +411,14 @@ class CRM_Event_Import_Form_MapField extends CRM_Import_Form_MapField { $skipColumnHeader = $this->controller->exportValue('DataSource', 'skipColumnHeader'); $config = CRM_Core_Config::singleton(); - $seperator = $config->fieldSeparator; + /* CRM - 19192 */ + $seperator = $this->controller->exportValue('DataSource', 'fieldSeparator'); + if(is_null($seperator)) { + $seperator = $config->fieldSeparator; + } + - $mapperKeys = array(); + $mapperKeys = array(); $mapper = array(); $mapperKeys = $this->controller->exportValue($this->_name, 'mapper'); $mapperKeysMain = array(); diff --git a/CRM/Event/Import/Form/Preview.php b/CRM/Event/Import/Form/Preview.php index 98cfa592d4..91c2d5542a 100644 --- a/CRM/Event/Import/Form/Preview.php +++ b/CRM/Event/Import/Form/Preview.php @@ -119,9 +119,14 @@ class CRM_Event_Import_Form_Preview extends CRM_Import_Form_Preview { $onDuplicate = $this->get('onDuplicate'); $config = CRM_Core_Config::singleton(); - $seperator = $config->fieldSeparator; + /* CRM - 19192 */ + $seperator = $this->controller->exportValue('DataSource', 'fieldSeparator'); + if (is_null($seperator)) { + $seperator = $config->fieldSeparator; + } + - $mapper = $this->controller->exportValue('MapField', 'mapper'); + $mapper = $this->controller->exportValue('MapField', 'mapper'); $mapperKeys = array(); foreach ($mapper as $key => $value) {