Skip to content

Commit

Permalink
Merge pull request #23240 from eileenmcnaughton/import_codes
Browse files Browse the repository at this point in the history
[REF] [Import] Remove warning count - never returned
  • Loading branch information
colemanw authored Apr 19, 2022
2 parents 0f4b341 + 06ef1cd commit 52de354
Show file tree
Hide file tree
Showing 7 changed files with 8 additions and 54 deletions.
9 changes: 1 addition & 8 deletions CRM/Activity/Import/Parser/Activity.php
Original file line number Diff line number Diff line change
Expand Up @@ -488,7 +488,7 @@ public function run(
return FALSE;
}

$this->_lineCount = $this->_warningCount = 0;
$this->_lineCount = 0;
$this->_invalidRowCount = $this->_validCount = 0;
$this->_totalCount = $this->_conflictCount = 0;

Expand Down Expand Up @@ -566,13 +566,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;
Expand Down
11 changes: 3 additions & 8 deletions CRM/Contact/Import/Parser/Contact.php
Original file line number Diff line number Diff line change
Expand Up @@ -270,6 +270,7 @@ public function init() {
*
* @return bool
* the result of this processing
* CRM_Import_Parser::ERROR or CRM_Import_Parser::VALID
*/
public function preview(&$values) {
return $this->summary($values);
Expand All @@ -283,6 +284,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;
Expand Down Expand Up @@ -2593,7 +2595,7 @@ public function run(

$this->init();

$this->_rowCount = $this->_warningCount = 0;
$this->_rowCount = 0;
$this->_invalidRowCount = $this->_validCount = 0;
$this->_totalCount = $this->_conflictCount = 0;

Expand Down Expand Up @@ -2678,13 +2680,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);
Expand Down
9 changes: 1 addition & 8 deletions CRM/Contribute/Import/Parser/Contribution.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -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;
Expand Down
9 changes: 1 addition & 8 deletions CRM/Custom/Import/Parser.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -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;
Expand Down
9 changes: 1 addition & 8 deletions CRM/Event/Import/Parser/Participant.php
Original file line number Diff line number Diff line change
Expand Up @@ -768,7 +768,7 @@ public function run(
return FALSE;
}

$this->_lineCount = $this->_warningCount = 0;
$this->_lineCount = 0;
$this->_invalidRowCount = $this->_validCount = 0;
$this->_totalCount = $this->_conflictCount = 0;

Expand Down Expand Up @@ -839,13 +839,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;
Expand Down
6 changes: 0 additions & 6 deletions CRM/Import/Parser.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
9 changes: 1 addition & 8 deletions CRM/Member/Import/Parser/Membership.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit 52de354

Please sign in to comment.