Skip to content

Commit 6007e86

Browse files
author
Korshenko, Olexii(okorshenko)
committed
Merge pull request #83 from magento-nord/merchant_beta
[Merchant beta] [Nord] Bug fix
2 parents a1873db + db9565a commit 6007e86

File tree

3 files changed

+6
-4
lines changed

3 files changed

+6
-4
lines changed

app/code/Magento/CatalogImportExport/Model/Import/Product.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1958,12 +1958,14 @@ protected function _saveStockItem()
19581958
} else {
19591959
$row['qty'] = 0;
19601960
}
1961-
$stockData[] = $row;
1961+
if (!isset($stockData[$rowData[self::COL_SKU]])) {
1962+
$stockData[$rowData[self::COL_SKU]] = $row;
1963+
}
19621964
}
19631965

19641966
// Insert rows
19651967
if (!empty($stockData)) {
1966-
$this->_connection->insertOnDuplicate($entityTable, $stockData);
1968+
$this->_connection->insertOnDuplicate($entityTable, array_values($stockData));
19671969
}
19681970

19691971
if ($productIdsToReindex) {

app/code/Magento/CatalogImportExport/Model/Import/Uploader.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ public function move($fileName, $renameFileOff = false)
155155

156156
$filePath = $this->_directory->getRelativePath($this->getTmpDir() . '/' . $fileName);
157157
$this->_setUploadFile($filePath);
158-
$result = $this->save($this->getDestDir());
158+
$result = $this->save($this->_directory->getAbsolutePath($this->getDestDir()));
159159
$result['name'] = self::getCorrectFileName($result['name']);
160160
return $result;
161161
}

app/code/Magento/CatalogImportExport/Test/Unit/Model/Import/UploaderTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ protected function setUp()
7171
->getMock();
7272

7373
$this->directoryMock = $this->getMockBuilder('\Magento\Framework\Filesystem\Directory\Writer')
74-
->setMethods(['writeFile', 'getRelativePath'])
74+
->setMethods(['writeFile', 'getRelativePath', 'getAbsolutePath'])
7575
->disableOriginalConstructor()
7676
->getMock();
7777

0 commit comments

Comments
 (0)