Skip to content

Commit 0b78821

Browse files
authored
Reset skippedRows array in clear method
Added skippedRows array in clear method, missing to clear this array can cause an issue when you programmatically import more than one file, especially in a foreach loop because this object is treated as singleton. In this case, in the next file of your loop, magento checks for skipped rows and skips rows based on previous file. A pseudo-code example is following: $files = ['file1.csv', 'file2.csv']; foreach ($files as $file) { .... // validate file .... // import file // if some file has skipped rows, skippedRows array is persistent between all files because is not cleared with clear() method called in validateData() method }
1 parent d491a45 commit 0b78821

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -325,6 +325,7 @@ public function clear()
325325
$this->items = [];
326326
$this->errorStatistics = [];
327327
$this->invalidRows = [];
328+
$this->skippedRows = [];
328329

329330
return $this;
330331
}

0 commit comments

Comments
 (0)