Skip to content

Commit 65c3eb8

Browse files
committed
Merge remote-tracking branch 'origin/MAGETWO-53783' into MPI-PR-3005
2 parents 18cbf02 + a35aece commit 65c3eb8

File tree

2 files changed

+4
-3
lines changed
  • app/code/Magento/OfflineShipping

2 files changed

+4
-3
lines changed

app/code/Magento/OfflineShipping/Model/ResourceModel/Carrier/Tablerate/Import.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -128,12 +128,13 @@ public function getData(ReadInterface $file, $websiteId, $conditionShortName, $c
128128
$items = [];
129129
while (false !== ($csvLine = $file->readCsv())) {
130130
try {
131+
$rowNumber++;
131132
if (empty($csvLine)) {
132133
continue;
133134
}
134135
$rowData = $this->rowParser->parse(
135136
$csvLine,
136-
++$rowNumber,
137+
$rowNumber,
137138
$websiteId,
138139
$conditionShortName,
139140
$conditionFullName,
@@ -151,7 +152,7 @@ public function getData(ReadInterface $file, $websiteId, $conditionShortName, $c
151152
)
152153
);
153154
}
154-
$this->uniqueHash[$hash] = $csvLine;
155+
$this->uniqueHash[$hash] = $rowNumber;
155156

156157
$items[] = $rowData;
157158
if (count($items) === $bunchSize) {

app/code/Magento/OfflineShipping/Test/Unit/Model/ResourceModel/Carrier/Tablerate/ImportTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,7 @@ public function testGetDataWithDuplicatedLine()
188188
}
189189
$this->assertEquals($expectedResult, $result);
190190
$this->assertTrue($this->import->hasErrors());
191-
$this->assertEquals(['Duplicate Row #%1 (duplicates row #%2)'], $this->import->getErrors());
191+
$this->assertEquals(['Duplicate Row #3 (duplicates row #2)'], $this->import->getErrors());
192192
}
193193

194194
/**

0 commit comments

Comments
 (0)