From 06ef1cdc3739899ccb59d7abe5abd66f14f5f23c Mon Sep 17 00:00:00 2001 From: Eileen McNaughton Date: Tue, 19 Apr 2022 10:01:19 +1200 Subject: [PATCH] [REF] [Import] Remove warning count - never returned --- CRM/Activity/Import/Parser/Activity.php | 9 +-------- CRM/Contact/Import/Parser/Contact.php | 11 +++-------- CRM/Contribute/Import/Parser/Contribution.php | 9 +-------- CRM/Custom/Import/Parser.php | 9 +-------- CRM/Event/Import/Parser/Participant.php | 9 +-------- CRM/Import/Parser.php | 6 ------ CRM/Member/Import/Parser/Membership.php | 9 +-------- 7 files changed, 8 insertions(+), 54 deletions(-) diff --git a/CRM/Activity/Import/Parser/Activity.php b/CRM/Activity/Import/Parser/Activity.php index 7014f313e1..9b9935f0da 100644 --- a/CRM/Activity/Import/Parser/Activity.php +++ b/CRM/Activity/Import/Parser/Activity.php @@ -500,7 +500,7 @@ class CRM_Activity_Import_Parser_Activity extends CRM_Import_Parser { return FALSE; } - $this->_lineCount = $this->_warningCount = 0; + $this->_lineCount = 0; $this->_invalidRowCount = $this->_validCount = 0; $this->_totalCount = $this->_conflictCount = 0; @@ -578,13 +578,6 @@ class CRM_Activity_Import_Parser_Activity extends CRM_Import_Parser { } } - if ($returnCode & self::WARNING) { - $this->_warningCount++; - if ($this->_warningCount < $this->_maxWarningCount) { - $this->_warningCount[] = $line; - } - } - if ($returnCode & self::ERROR) { $this->_invalidRowCount++; $recordNumber = $this->_lineCount; diff --git a/CRM/Contact/Import/Parser/Contact.php b/CRM/Contact/Import/Parser/Contact.php index 9c0fddb988..953a999d52 100644 --- a/CRM/Contact/Import/Parser/Contact.php +++ b/CRM/Contact/Import/Parser/Contact.php @@ -282,6 +282,7 @@ class CRM_Contact_Import_Parser_Contact extends CRM_Import_Parser { * * @return bool * the result of this processing + * CRM_Import_Parser::ERROR or CRM_Import_Parser::VALID */ public function preview(&$values) { return $this->summary($values); @@ -295,6 +296,7 @@ class CRM_Contact_Import_Parser_Contact extends CRM_Import_Parser { * * @return bool * the result of this processing + * CRM_Import_Parser::ERROR or CRM_Import_Parser::VALID */ public function summary(&$values): int { $erroneousField = NULL; @@ -2605,7 +2607,7 @@ class CRM_Contact_Import_Parser_Contact extends CRM_Import_Parser { $this->init(); - $this->_rowCount = $this->_warningCount = 0; + $this->_rowCount = 0; $this->_invalidRowCount = $this->_validCount = 0; $this->_totalCount = $this->_conflictCount = 0; @@ -2690,13 +2692,6 @@ class CRM_Contact_Import_Parser_Contact extends CRM_Import_Parser { } } - if ($returnCode & self::WARNING) { - $this->_warningCount++; - if ($this->_warningCount < $this->_maxWarningCount) { - $this->_warningCount[] = $line; - } - } - if ($returnCode & self::ERROR) { $this->_invalidRowCount++; array_unshift($values, $this->_rowCount); diff --git a/CRM/Contribute/Import/Parser/Contribution.php b/CRM/Contribute/Import/Parser/Contribution.php index b7ce5392c6..1aa59b38fe 100644 --- a/CRM/Contribute/Import/Parser/Contribution.php +++ b/CRM/Contribute/Import/Parser/Contribution.php @@ -189,7 +189,7 @@ class CRM_Contribute_Import_Parser_Contribution extends CRM_Import_Parser { return FALSE; } - $this->_lineCount = $this->_warningCount = $this->_validSoftCreditRowCount = $this->_validPledgePaymentRowCount = 0; + $this->_lineCount = $this->_validSoftCreditRowCount = $this->_validPledgePaymentRowCount = 0; $this->_invalidRowCount = $this->_validCount = $this->_invalidSoftCreditRowCount = $this->_invalidPledgePaymentRowCount = 0; $this->_totalCount = $this->_conflictCount = 0; @@ -287,13 +287,6 @@ class CRM_Contribute_Import_Parser_Contribution extends CRM_Import_Parser { } } - if ($returnCode == self::WARNING) { - $this->_warningCount++; - if ($this->_warningCount < $this->_maxWarningCount) { - $this->_warningCount[] = $line; - } - } - if ($returnCode == self::ERROR) { $this->_invalidRowCount++; $recordNumber = $this->_lineCount; diff --git a/CRM/Custom/Import/Parser.php b/CRM/Custom/Import/Parser.php index 084937081f..e7e8b134eb 100644 --- a/CRM/Custom/Import/Parser.php +++ b/CRM/Custom/Import/Parser.php @@ -93,7 +93,7 @@ abstract class CRM_Custom_Import_Parser extends CRM_Import_Parser { return FALSE; } - $this->_lineCount = $this->_warningCount = 0; + $this->_lineCount = 0; $this->_invalidRowCount = $this->_validCount = 0; $this->_totalCount = $this->_conflictCount = 0; @@ -164,13 +164,6 @@ abstract class CRM_Custom_Import_Parser extends CRM_Import_Parser { } } - if ($returnCode & self::WARNING) { - $this->_warningCount++; - if ($this->_warningCount < $this->_maxWarningCount) { - $this->_warnings[] = $this->_lineCount; - } - } - if ($returnCode & self::ERROR) { $this->_invalidRowCount++; $recordNumber = $this->_lineCount; diff --git a/CRM/Event/Import/Parser/Participant.php b/CRM/Event/Import/Parser/Participant.php index 7c555decec..9d93e550be 100644 --- a/CRM/Event/Import/Parser/Participant.php +++ b/CRM/Event/Import/Parser/Participant.php @@ -780,7 +780,7 @@ class CRM_Event_Import_Parser_Participant extends CRM_Import_Parser { return FALSE; } - $this->_lineCount = $this->_warningCount = 0; + $this->_lineCount = 0; $this->_invalidRowCount = $this->_validCount = 0; $this->_totalCount = $this->_conflictCount = 0; @@ -851,13 +851,6 @@ class CRM_Event_Import_Parser_Participant extends CRM_Import_Parser { } } - if ($returnCode & self::WARNING) { - $this->_warningCount++; - if ($this->_warningCount < $this->_maxWarningCount) { - $this->_warningCount[] = $line; - } - } - if ($returnCode & self::ERROR) { $this->_invalidRowCount++; $recordNumber = $this->_lineCount; diff --git a/CRM/Import/Parser.php b/CRM/Import/Parser.php index eb05e31038..0fe2694668 100644 --- a/CRM/Import/Parser.php +++ b/CRM/Import/Parser.php @@ -96,12 +96,6 @@ abstract class CRM_Import_Parser { */ protected $_duplicates; - /** - * Running total number of warnings - * @var int - */ - protected $_warningCount; - /** * Maximum number of warnings to store * @var int diff --git a/CRM/Member/Import/Parser/Membership.php b/CRM/Member/Import/Parser/Membership.php index a4e4758fa9..c0ce52c25f 100644 --- a/CRM/Member/Import/Parser/Membership.php +++ b/CRM/Member/Import/Parser/Membership.php @@ -131,7 +131,7 @@ class CRM_Member_Import_Parser_Membership extends CRM_Import_Parser { return FALSE; } - $this->_lineCount = $this->_warningCount = 0; + $this->_lineCount = 0; $this->_invalidRowCount = $this->_validCount = 0; $this->_totalCount = $this->_conflictCount = 0; @@ -207,13 +207,6 @@ class CRM_Member_Import_Parser_Membership extends CRM_Import_Parser { } } - if ($returnCode & self::WARNING) { - $this->_warningCount++; - if ($this->_warningCount < $this->_maxWarningCount) { - $this->_warningCount[] = $line; - } - } - if ($returnCode & self::ERROR) { $this->_invalidRowCount++; $recordNumber = $this->_lineCount; -- 2.25.1