From e6859ac58675126f606872cf2379b3eaf35a94a0 Mon Sep 17 00:00:00 2001 From: VanagaS Date: Mon, 19 Sep 2016 20:32:49 +0530 Subject: [PATCH] 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. --- CRM/Event/Import/Form/MapField.php | 9 +++++++-- CRM/Event/Import/Form/Preview.php | 9 +++++++-- 2 files changed, 14 insertions(+), 4 deletions(-) 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) { -- 2.25.1