diff --git a/CRM/Contact/Import/Form/DataSource.php b/CRM/Contact/Import/Form/DataSource.php index 2a7b1839e67f..7d27f78d4a98 100644 --- a/CRM/Contact/Import/Form/DataSource.php +++ b/CRM/Contact/Import/Form/DataSource.php @@ -307,17 +307,16 @@ public function postProcess() { $this->_params = $this->controller->exportValues($this->_name); $storeParams = [ - 'onDuplicate' => 'onDuplicate', - 'dedupe' => 'dedupe', - 'contactType' => 'contactType', - 'contactSubType' => 'subType', - 'dateFormats' => 'dateFormats', - 'savedMapping' => 'savedMapping', + 'onDuplicate' => $this->exportValue('onDuplicate'), + 'dedupe' => $this->exportValue('dedupe'), + 'contactType' => $this->exportValue('contactType'), + 'contactSubType' => $this->exportValue('subType'), + 'dateFormats' => $this->exportValue('dateFormats'), + 'savedMapping' => $this->exportValue('savedMapping'), ]; - foreach ($storeParams as $storeName => $storeValueName) { - $$storeName = $this->exportValue($storeValueName); - $this->set($storeName, $$storeName); + foreach ($storeParams as $storeName => $value) { + $this->set($storeName, $value); } $this->set('disableUSPS', !empty($this->_params['disableUSPS'])); @@ -325,7 +324,7 @@ public function postProcess() { $this->set('skipColumnHeader', CRM_Utils_Array::value('skipColumnHeader', $this->_params)); $session = CRM_Core_Session::singleton(); - $session->set('dateTypes', $dateFormats); + $session->set('dateTypes', $storeParams['dateFormats']); // Get the PEAR::DB object $dao = new CRM_Core_DAO(); @@ -349,14 +348,14 @@ public function postProcess() { $parser->run($importTableName, $mapper, CRM_Import_Parser::MODE_MAPFIELD, - $contactType, + $storeParams['contactType'], $fieldNames['pk'], $fieldNames['status'], CRM_Import_Parser::DUPLICATE_SKIP, NULL, NULL, FALSE, CRM_Contact_Import_Parser::DEFAULT_TIMEOUT, - $contactSubType, - $dedupe + $storeParams['contactSubType'], + $storeParams['dedupe'] ); // add all the necessary variables to the form