CRM-19192 - Event participant (and possibly other entity) imports do not handle ...
authorVanagaS <udanvh.cnsmjt.vanagas@gmail.com>
Mon, 19 Sep 2016 15:02:49 +0000 (20:32 +0530)
committerjitendrapurohit <jitendra.purohit@webaccessglobal.com>
Wed, 21 Sep 2016 13:22:34 +0000 (18:52 +0530)
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
CRM/Event/Import/Form/Preview.php

index a94c0be47c7b54609acfd60c99e8e576f84e67a8..d7fab0ec8c967c0ec95cb7182472197321c391c2 100644 (file)
@@ -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();
index 98cfa592d40dfb7ae5b79c7b1a3eb17ac0fb2d42..91c2d5542ae98085033ebc1c450c2efcde1b3f90 100644 (file)
@@ -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) {