From c169525f72b1f956d58cec1e4a15b0f57de3eabf Mon Sep 17 00:00:00 2001 From: Eileen McNaughton Date: Fri, 6 May 2022 16:34:45 +1200 Subject: [PATCH] [REF] [Import] Stop passing unused param --- CRM/Contact/Import/Form/DataSource.php | 12 ++---------- CRM/Contact/Import/Form/MapField.php | 10 +--------- CRM/Contact/Import/ImportJob.php | 13 +++---------- CRM/Contact/Import/Parser/Contact.php | 12 +----------- 4 files changed, 7 insertions(+), 40 deletions(-) diff --git a/CRM/Contact/Import/Form/DataSource.php b/CRM/Contact/Import/Form/DataSource.php index 6ba0d22a39..12e27b0a72 100644 --- a/CRM/Contact/Import/Form/DataSource.php +++ b/CRM/Contact/Import/Form/DataSource.php @@ -217,17 +217,9 @@ class CRM_Contact_Import_Form_DataSource extends CRM_Import_Forms { $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 diff --git a/CRM/Contact/Import/Form/MapField.php b/CRM/Contact/Import/Form/MapField.php index 7a1d38498f..4468257fef 100644 --- a/CRM/Contact/Import/Form/MapField.php +++ b/CRM/Contact/Import/Form/MapField.php @@ -554,15 +554,7 @@ class CRM_Contact_Import_Form_MapField extends CRM_Import_Form_MapField { $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; } diff --git a/CRM/Contact/Import/ImportJob.php b/CRM/Contact/Import/ImportJob.php index f9f3c49cc9..34b6dae7e7 100644 --- a/CRM/Contact/Import/ImportJob.php +++ b/CRM/Contact/Import/ImportJob.php @@ -178,18 +178,11 @@ class CRM_Contact_Import_ImportJob { $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(); diff --git a/CRM/Contact/Import/Parser/Contact.php b/CRM/Contact/Import/Parser/Contact.php index f670fa1e62..6c48f75245 100644 --- a/CRM/Contact/Import/Parser/Contact.php +++ b/CRM/Contact/Import/Parser/Contact.php @@ -2435,27 +2435,17 @@ class CRM_Contact_Import_Parser_Contact extends CRM_Import_Parser { /** * 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 ) { -- 2.25.1