$this->flushDataSource();
$this->updateUserJobMetadata('submitted_values', $this->getSubmittedValues());
}
- // Setup the params array
- $this->_params = $this->controller->exportValues($this->_name);
// @todo - this params are being set here because they were / possibly still
// are in some places being accessed by forms later in the flow
// Once the mentioned forms no longer call $this->get() all this 'setting'
// is obsolete.
$storeParams = [
- 'onDuplicate' => $this->getSubmittedValue('onDuplicate'),
- 'dedupe' => $this->getSubmittedValue('dedupe_rule_id'),
- 'contactType' => $this->getSubmittedValue('contactType'),
'dateFormats' => $this->getSubmittedValue('dateFormats'),
'savedMapping' => $this->getSubmittedValue('savedMapping'),
];
CRM_Core_Session::singleton()->set('dateTypes', $storeParams['dateFormats']);
$this->instantiateDataSource();
-
- $mapper = [];
-
- $parser = new CRM_Contact_Import_Parser_Contact($mapper);
- $parser->setMaxLinesToProcess(100);
- $parser->setUserJobID($this->getUserJobID());
- $parser->run(
- [],
- CRM_Import_Parser::MODE_MAPFIELD
- );
-
}
/**
if ($mode == self::MODE_IMPORT) {
$dataSource->setStatuses(['new']);
}
- if ($this->_maxLinesToProcess > 0) {
- // Note this would only be the case in MapForm mode, where it is set to 100
- // rows. In fact mapField really only needs 2 rows - the reason for
- // 100 seems to be that the other import classes are processing a
- // csv file, and there was a concern that some rows might have more
- // columns than others - hence checking 100 rows perhaps seemed like
- // a good precaution presumably when determining the activeFieldsCount
- // which is the number of columns a row might have.
- // However, the mapField class may no longer use activeFieldsCount for contact
- // to be continued....
- $dataSource->setLimit($this->_maxLinesToProcess);
- }
while ($row = $dataSource->getRow()) {
$values = array_values($row);
$this->_totalCount++;
- if ($mode == self::MODE_MAPFIELD) {
- $returnCode = CRM_Import_Parser::VALID;
- }
- elseif ($mode == self::MODE_PREVIEW) {
+ if ($mode == self::MODE_PREVIEW) {
$returnCode = $this->preview($values);
}
elseif ($mode == self::MODE_SUMMARY) {