Skip to content

Commit dce931b

Browse files
committed
Merge pull request #213 from magento-sparta/MDVA-24
[SUPPORT] MDVA-24: Problems when importing product data with store_view_code
2 parents 044de2d + 5c0596d commit dce931b

File tree

2 files changed

+0
-35
lines changed

2 files changed

+0
-35
lines changed

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

Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1120,7 +1120,6 @@ protected function _saveProductAttributes(array $attributesData)
11201120
{
11211121
foreach ($attributesData as $tableName => $skuData) {
11221122
$tableData = [];
1123-
$where = [];
11241123
foreach ($skuData as $sku => $attributes) {
11251124
$productId = $this->skuProcessor->getNewSku($sku)['entity_id'];
11261125

@@ -1133,30 +1132,8 @@ protected function _saveProductAttributes(array $attributesData)
11331132
'value' => $storeValue,
11341133
];
11351134
}
1136-
/*
1137-
If the store based values are not provided for a particular store,
1138-
we default to the default scope values.
1139-
In this case, remove all the existing store based values stored in the table.
1140-
*/
1141-
$where[] = $this->_connection->quoteInto(
1142-
'(store_id NOT IN (?)',
1143-
array_keys($storeValues)
1144-
) . $this->_connection->quoteInto(
1145-
' AND attribute_id = ?',
1146-
$attributeId
1147-
) . $this->_connection->quoteInto(
1148-
' AND entity_id = ?)',
1149-
$productId
1150-
);
1151-
if (count($where) >= self::ATTRIBUTE_DELETE_BUNCH) {
1152-
$this->_connection->delete($tableName, implode(' OR ', $where));
1153-
$where = [];
1154-
}
11551135
}
11561136
}
1157-
if (!empty($where)) {
1158-
$this->_connection->delete($tableName, implode(' OR ', $where));
1159-
}
11601137
$this->_connection->insertOnDuplicate($tableName, $tableData, ['value']);
11611138
}
11621139
return $this;

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

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -504,18 +504,6 @@ public function testSaveProductAttributes()
504504
$this->_connection->expects($this->any())
505505
->method('quoteInto')
506506
->willReturnCallback([$this, 'returnQuoteCallback']);
507-
$this->_connection
508-
->expects($this->once())
509-
->method('delete')
510-
->with(
511-
$this->equalTo($testTable),
512-
$this->equalTo(
513-
'(store_id NOT IN ('
514-
. $storeId . ') AND attribute_id = '
515-
. $attributeId . ' AND entity_id = '
516-
. self::ENTITY_ID . ')'
517-
)
518-
);
519507

520508
$tableData[] = [
521509
'entity_id' => self::ENTITY_ID,

0 commit comments

Comments
 (0)