From: Eileen McNaughton Date: Tue, 7 Jun 2022 19:38:08 +0000 (+1200) Subject: A couple more fixes.. X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=965259cf2653370e9b5429116c80fb1e63f65d1b;p=civicrm-core.git A couple more fixes.. --- diff --git a/CRM/Event/Import/Form/MapField.php b/CRM/Event/Import/Form/MapField.php index c27e7f6eda..22c4741528 100644 --- a/CRM/Event/Import/Form/MapField.php +++ b/CRM/Event/Import/Form/MapField.php @@ -62,7 +62,7 @@ class CRM_Event_Import_Form_MapField extends CRM_Import_Form_MapField { $defaults = []; $mapperKeys = array_keys($this->_mapperFields); - $hasHeaders = !empty($this->_columnHeaders); + $hasHeaders = $this->getSubmittedValue('skipColumnHeader'); $headerPatterns = $this->getHeaderPatterns(); $dataPatterns = $this->getDataPatterns(); $savedMappingID = $this->getSubmittedValue('savedMapping'); @@ -111,7 +111,7 @@ class CRM_Event_Import_Form_MapField extends CRM_Import_Form_MapField { $js .= "swapOptions($formName, 'mapper[$i]', 0, 3, 'hs_mapper_" . $i . "_');\n"; if ($hasHeaders) { - $defaults["mapper[$i]"] = array($this->defaultFromHeader($this->_columnHeaders[$i], $headerPatterns)); + $defaults["mapper[$i]"] = array($this->defaultFromHeader($columnHeader, $headerPatterns)); } else { $defaults["mapper[$i]"] = array($this->defaultFromData($dataPatterns, $i)); @@ -124,7 +124,7 @@ class CRM_Event_Import_Form_MapField extends CRM_Import_Form_MapField { if ($hasHeaders) { // Infer the default from the skipped headers if we have them $defaults["mapper[$i]"] = array( - $this->defaultFromHeader($this->_columnHeaders[$i], + $this->defaultFromHeader($columnHeader, $headerPatterns ), // $defaultLocationType->id diff --git a/CRM/Event/Import/Parser/Participant.php b/CRM/Event/Import/Parser/Participant.php index 8098f6ba48..4dc061ee65 100644 --- a/CRM/Event/Import/Parser/Participant.php +++ b/CRM/Event/Import/Parser/Participant.php @@ -75,6 +75,7 @@ class CRM_Event_Import_Parser_Participant extends CRM_Import_Parser { * The initializer code, called before the processing. */ public function init() { + unset($this->userJob); $this->setFieldMetadata(); foreach ($this->importableFieldsMetadata as $name => $field) { $field['type'] = CRM_Utils_Array::value('type', $field, CRM_Utils_Type::T_INT);