Skip to content

Commit 0832e29

Browse files
committed
magento-engcom#30: Extend isErrorAlreadyAdded check to also check column name so several columns in the same row may throw the same error and they can be distinguished.
1 parent a8ee555 commit 0832e29

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

app/code/Magento/ImportExport/Model/Import/ErrorProcessing/ProcessingErrorAggregator.php

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ public function addError(
7777
$errorMessage = null,
7878
$errorDescription = null
7979
) {
80-
if ($this->isErrorAlreadyAdded($rowNumber, $errorCode)) {
80+
if ($this->isErrorAlreadyAdded($rowNumber, $errorCode, $columnName)) {
8181
return $this;
8282
}
8383
$this->processErrorStatistics($errorLevel);
@@ -333,13 +333,14 @@ public function clear()
333333
/**
334334
* @param int $rowNum
335335
* @param string $errorCode
336+
* @param string $columnName
336337
* @return bool
337338
*/
338-
protected function isErrorAlreadyAdded($rowNum, $errorCode)
339+
protected function isErrorAlreadyAdded($rowNum, $errorCode, $columnName = null)
339340
{
340341
$errors = $this->getErrorsByCode([$errorCode]);
341342
foreach ($errors as $error) {
342-
if ($rowNum == $error->getRowNumber()) {
343+
if ($rowNum == $error->getRowNumber() && $columnName == $error->getColumnName()) {
343344
return true;
344345
}
345346
}

0 commit comments

Comments
 (0)