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 7014f313e1f3..9b9935f0da26 100644 --- a/CRM/Activity/Import/Parser/Activity.php +++ b/CRM/Activity/Import/Parser/Activity.php @@ -500,7 +500,7 @@ public function run( return FALSE; } - $this->_lineCount = $this->_warningCount = 0; + $this->_lineCount = 0; $this->_invalidRowCount = $this->_validCount = 0; $this->_totalCount = $this->_conflictCount = 0; @@ -578,13 +578,6 @@ public function run( } } - 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 9c0fddb98810..953a999d5253 100644 --- a/CRM/Contact/Import/Parser/Contact.php +++ b/CRM/Contact/Import/Parser/Contact.php @@ -282,6 +282,7 @@ public function mapField(&$values) { * * @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 @@ public function preview(&$values) { * * @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 @@ public function run( $this->init(); - $this->_rowCount = $this->_warningCount = 0; + $this->_rowCount = 0; $this->_invalidRowCount = $this->_validCount = 0; $this->_totalCount = $this->_conflictCount = 0; @@ -2690,13 +2692,6 @@ public function run( } } - 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 b7ce5392c6dd..1aa59b38fed4 100644 --- a/CRM/Contribute/Import/Parser/Contribution.php +++ b/CRM/Contribute/Import/Parser/Contribution.php @@ -189,7 +189,7 @@ public function run( 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 @@ public function run( } } - 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 084937081f37..e7e8b134eb26 100644 --- a/CRM/Custom/Import/Parser.php +++ b/CRM/Custom/Import/Parser.php @@ -93,7 +93,7 @@ public function run( return FALSE; } - $this->_lineCount = $this->_warningCount = 0; + $this->_lineCount = 0; $this->_invalidRowCount = $this->_validCount = 0; $this->_totalCount = $this->_conflictCount = 0; @@ -164,13 +164,6 @@ public function run( } } - 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 7c555dececde..9d93e550be3d 100644 --- a/CRM/Event/Import/Parser/Participant.php +++ b/CRM/Event/Import/Parser/Participant.php @@ -780,7 +780,7 @@ public function run( return FALSE; } - $this->_lineCount = $this->_warningCount = 0; + $this->_lineCount = 0; $this->_invalidRowCount = $this->_validCount = 0; $this->_totalCount = $this->_conflictCount = 0; @@ -851,13 +851,6 @@ public function run( } } - 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 eb05e3103823..0fe26946683f 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 a4e4758fa95b..c0ce52c25fdc 100644 --- a/CRM/Member/Import/Parser/Membership.php +++ b/CRM/Member/Import/Parser/Membership.php @@ -131,7 +131,7 @@ public function run( return FALSE; } - $this->_lineCount = $this->_warningCount = 0; + $this->_lineCount = 0; $this->_invalidRowCount = $this->_validCount = 0; $this->_totalCount = $this->_conflictCount = 0; @@ -207,13 +207,6 @@ public function run( } } - if ($returnCode & self::WARNING) { - $this->_warningCount++; - if ($this->_warningCount < $this->_maxWarningCount) { - $this->_warningCount[] = $line; - } - } - if ($returnCode & self::ERROR) { $this->_invalidRowCount++; $recordNumber = $this->_lineCount;