Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[REF] [Import] Stop passing unused parameters #23386

Merged
merged 1 commit into from
May 6, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 2 additions & 10 deletions CRM/Contact/Import/Form/DataSource.php
Original file line number Diff line number Diff line change
Expand Up @@ -217,17 +217,9 @@ public function postProcess() {
$parser = new CRM_Contact_Import_Parser_Contact($mapper);
$parser->setMaxLinesToProcess(100);
$parser->setUserJobID($this->getUserJobID());
$parser->run(NULL,
$parser->run(
[],
CRM_Import_Parser::MODE_MAPFIELD,
$this->getSubmittedValue('contactType'),
'_id',
'_status',
CRM_Import_Parser::DUPLICATE_SKIP,
NULL, NULL, FALSE,
CRM_Contact_Import_Parser_Contact::DEFAULT_TIMEOUT,
$this->getSubmittedValue('contactSubType'),
$this->getSubmittedValue('dedupe_rule_id')
CRM_Import_Parser::MODE_MAPFIELD
);

// add all the necessary variables to the form
Expand Down
10 changes: 1 addition & 9 deletions CRM/Contact/Import/Form/MapField.php
Original file line number Diff line number Diff line change
Expand Up @@ -554,15 +554,7 @@ public function submit($params, $mapperKeys) {

$parser->run(NULL,
$mapper,
CRM_Import_Parser::MODE_PREVIEW,
NULL,
'_id',
'_status',
(int) $this->getSubmittedValue('onDuplicate'),
NULL, NULL, FALSE,
CRM_Contact_Import_Parser_Contact::DEFAULT_TIMEOUT,
$this->getSubmittedValue('contactSubType'),
$this->getSubmittedValue('dedupe_rule_id')
CRM_Import_Parser::MODE_PREVIEW
);
return $parser;
}
Expand Down
13 changes: 3 additions & 10 deletions CRM/Contact/Import/ImportJob.php
Original file line number Diff line number Diff line change
Expand Up @@ -178,18 +178,11 @@ public function runImport(&$form, $timeout = 55) {
$parserParameters['relatedContactWebsiteType']
);
$this->_parser->setUserJobID($this->_userJobID);
$this->_parser->run(NULL, $mapperFields,
$this->_parser->run(
$mapperFields,
CRM_Import_Parser::MODE_IMPORT,
$this->_contactType,
$this->_primaryKeyName,
$this->_statusFieldName,
$this->_onDuplicate,
$this->_statusID,
$this->_totalRowCount,
$this->_doGeocodeAddress,
CRM_Contact_Import_Parser_Contact::DEFAULT_TIMEOUT,
$this->_contactSubType,
$this->_dedupe
$this->_totalRowCount
);

$contactIds = $this->_parser->getImportedContacts();
Expand Down
12 changes: 1 addition & 11 deletions CRM/Contact/Import/Parser/Contact.php
Original file line number Diff line number Diff line change
Expand Up @@ -2435,27 +2435,17 @@ public function deprecated_contact_check_params(
/**
* Run import.
*
* @param string $tableName
* @param array $mapper
* @param int $mode
* @param int $contactType
* @param string $primaryKeyName
* @param string $statusFieldName
* @param int $onDuplicate
* @param int $statusID
* @param int $totalRowCount
*
* @return mixed
* @throws \API_Exception
* @throws \API_Exception|\CRM_Core_Exception
*/
public function run(
$tableName,
$mapper = [],
$mode = self::MODE_PREVIEW,
$contactType = self::CONTACT_INDIVIDUAL,
$primaryKeyName = '_id',
$statusFieldName = '_status',
$onDuplicate = self::DUPLICATE_SKIP,
$statusID = NULL,
$totalRowCount = NULL
) {
Expand Down