From ca2057ea8c50d7ef19be5bfe95b31189593409e4 Mon Sep 17 00:00:00 2001 From: Sean Madsen Date: Thu, 2 Nov 2017 20:54:22 -0400 Subject: [PATCH] CRM-14343 - Remove 250 limit for import errors --- CRM/Activity/Import/Parser.php | 12 +++++------ CRM/Contact/Import/Parser.php | 6 ++---- CRM/Contribute/Import/Parser.php | 36 +++++++++++++------------------- CRM/Custom/Import/Parser.php | 12 +++++------ CRM/Event/Import/Parser.php | 12 +++++------ CRM/Import/Parser.php | 8 +------ CRM/Member/Import/Parser.php | 8 +++---- 7 files changed, 36 insertions(+), 58 deletions(-) diff --git a/CRM/Activity/Import/Parser.php b/CRM/Activity/Import/Parser.php index 0c0d35161d..62af0b7a35 100644 --- a/CRM/Activity/Import/Parser.php +++ b/CRM/Activity/Import/Parser.php @@ -171,14 +171,12 @@ abstract class CRM_Activity_Import_Parser extends CRM_Import_Parser { if ($returnCode & self::ERROR) { $this->_invalidRowCount++; - if ($this->_invalidRowCount < $this->_maxErrorCount) { - $recordNumber = $this->_lineCount; - if ($this->_haveColumnHeader) { - $recordNumber--; - } - array_unshift($values, $recordNumber); - $this->_errors[] = $values; + $recordNumber = $this->_lineCount; + if ($this->_haveColumnHeader) { + $recordNumber--; } + array_unshift($values, $recordNumber); + $this->_errors[] = $values; } if ($returnCode & self::CONFLICT) { diff --git a/CRM/Contact/Import/Parser.php b/CRM/Contact/Import/Parser.php index 933f34bb86..0125b16256 100644 --- a/CRM/Contact/Import/Parser.php +++ b/CRM/Contact/Import/Parser.php @@ -271,10 +271,8 @@ abstract class CRM_Contact_Import_Parser extends CRM_Import_Parser { if ($returnCode & self::ERROR) { $this->_invalidRowCount++; - if ($this->_invalidRowCount < $this->_maxErrorCount) { - array_unshift($values, $this->_rowCount); - $this->_errors[] = $values; - } + array_unshift($values, $this->_rowCount); + $this->_errors[] = $values; } if ($returnCode & self::CONFLICT) { diff --git a/CRM/Contribute/Import/Parser.php b/CRM/Contribute/Import/Parser.php index 46b841f259..46472f9e1e 100644 --- a/CRM/Contribute/Import/Parser.php +++ b/CRM/Contribute/Import/Parser.php @@ -256,38 +256,32 @@ abstract class CRM_Contribute_Import_Parser extends CRM_Import_Parser { if ($returnCode == self::ERROR) { $this->_invalidRowCount++; - if ($this->_invalidRowCount < $this->_maxErrorCount) { - $recordNumber = $this->_lineCount; - if ($this->_haveColumnHeader) { - $recordNumber--; - } - array_unshift($values, $recordNumber); - $this->_errors[] = $values; + $recordNumber = $this->_lineCount; + if ($this->_haveColumnHeader) { + $recordNumber--; } + array_unshift($values, $recordNumber); + $this->_errors[] = $values; } if ($returnCode == self::PLEDGE_PAYMENT_ERROR) { $this->_invalidPledgePaymentRowCount++; - if ($this->_invalidPledgePaymentRowCount < $this->_maxErrorCount) { - $recordNumber = $this->_lineCount; - if ($this->_haveColumnHeader) { - $recordNumber--; - } - array_unshift($values, $recordNumber); - $this->_pledgePaymentErrors[] = $values; + $recordNumber = $this->_lineCount; + if ($this->_haveColumnHeader) { + $recordNumber--; } + array_unshift($values, $recordNumber); + $this->_pledgePaymentErrors[] = $values; } if ($returnCode == self::SOFT_CREDIT_ERROR) { $this->_invalidSoftCreditRowCount++; - if ($this->_invalidSoftCreditRowCount < $this->_maxErrorCount) { - $recordNumber = $this->_lineCount; - if ($this->_haveColumnHeader) { - $recordNumber--; - } - array_unshift($values, $recordNumber); - $this->_softCreditErrors[] = $values; + $recordNumber = $this->_lineCount; + if ($this->_haveColumnHeader) { + $recordNumber--; } + array_unshift($values, $recordNumber); + $this->_softCreditErrors[] = $values; } if ($returnCode == self::CONFLICT) { diff --git a/CRM/Custom/Import/Parser.php b/CRM/Custom/Import/Parser.php index 9d5d6432e4..3d40b62928 100644 --- a/CRM/Custom/Import/Parser.php +++ b/CRM/Custom/Import/Parser.php @@ -191,14 +191,12 @@ abstract class CRM_Custom_Import_Parser extends CRM_Contact_Import_Parser { if ($returnCode & self::ERROR) { $this->_invalidRowCount++; - if ($this->_invalidRowCount < $this->_maxErrorCount) { - $recordNumber = $this->_lineCount; - if ($this->_haveColumnHeader) { - $recordNumber--; - } - array_unshift($values, $recordNumber); - $this->_errors[] = $values; + $recordNumber = $this->_lineCount; + if ($this->_haveColumnHeader) { + $recordNumber--; } + array_unshift($values, $recordNumber); + $this->_errors[] = $values; } if ($returnCode & self::CONFLICT) { diff --git a/CRM/Event/Import/Parser.php b/CRM/Event/Import/Parser.php index 12ecfcf360..d723ca7f21 100644 --- a/CRM/Event/Import/Parser.php +++ b/CRM/Event/Import/Parser.php @@ -192,14 +192,12 @@ abstract class CRM_Event_Import_Parser extends CRM_Import_Parser { if ($returnCode & self::ERROR) { $this->_invalidRowCount++; - if ($this->_invalidRowCount < $this->_maxErrorCount) { - $recordNumber = $this->_lineCount; - if ($this->_haveColumnHeader) { - $recordNumber--; - } - array_unshift($values, $recordNumber); - $this->_errors[] = $values; + $recordNumber = $this->_lineCount; + if ($this->_haveColumnHeader) { + $recordNumber--; } + array_unshift($values, $recordNumber); + $this->_errors[] = $values; } if ($returnCode & self::CONFLICT) { diff --git a/CRM/Import/Parser.php b/CRM/Import/Parser.php index c4169c2c5d..738254e5c1 100644 --- a/CRM/Import/Parser.php +++ b/CRM/Import/Parser.php @@ -34,7 +34,7 @@ abstract class CRM_Import_Parser { /** * Settings */ - const MAX_ERRORS = 250, MAX_WARNINGS = 25, DEFAULT_TIMEOUT = 30; + const MAX_WARNINGS = 25, DEFAULT_TIMEOUT = 30; /** * Return codes @@ -79,11 +79,6 @@ abstract class CRM_Import_Parser { */ protected $_maxLinesToProcess; - /** - * Maximum number of invalid rows to store - */ - protected $_maxErrorCount; - /** * Array of error lines, bounded by MAX_ERROR */ @@ -192,7 +187,6 @@ abstract class CRM_Import_Parser { */ public function __construct() { $this->_maxLinesToProcess = 0; - $this->_maxErrorCount = self::MAX_ERRORS; } /** diff --git a/CRM/Member/Import/Parser.php b/CRM/Member/Import/Parser.php index fe2ae708ad..fdf5014a5c 100644 --- a/CRM/Member/Import/Parser.php +++ b/CRM/Member/Import/Parser.php @@ -191,11 +191,9 @@ abstract class CRM_Member_Import_Parser extends CRM_Import_Parser { if ($returnCode & self::ERROR) { $this->_invalidRowCount++; - if ($this->_invalidRowCount < $this->_maxErrorCount) { - $recordNumber = $this->_lineCount; - array_unshift($values, $recordNumber); - $this->_errors[] = $values; - } + $recordNumber = $this->_lineCount; + array_unshift($values, $recordNumber); + $this->_errors[] = $values; } if ($returnCode & self::CONFLICT) { -- 2.25.1