Skip to content

Commit

Permalink
Merge remote-tracking branch 'mainline/develop' into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
Yaroslav Onischenko committed Nov 30, 2015
2 parents 21cd1b4 + dce931b commit 28709d5
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 35 deletions.
23 changes: 0 additions & 23 deletions app/code/Magento/CatalogImportExport/Model/Import/Product.php
Original file line number Diff line number Diff line change
Expand Up @@ -1120,7 +1120,6 @@ protected function _saveProductAttributes(array $attributesData)
{
foreach ($attributesData as $tableName => $skuData) {
$tableData = [];
$where = [];
foreach ($skuData as $sku => $attributes) {
$productId = $this->skuProcessor->getNewSku($sku)['entity_id'];

Expand All @@ -1133,30 +1132,8 @@ protected function _saveProductAttributes(array $attributesData)
'value' => $storeValue,
];
}
/*
If the store based values are not provided for a particular store,
we default to the default scope values.
In this case, remove all the existing store based values stored in the table.
*/
$where[] = $this->_connection->quoteInto(
'(store_id NOT IN (?)',
array_keys($storeValues)
) . $this->_connection->quoteInto(
' AND attribute_id = ?',
$attributeId
) . $this->_connection->quoteInto(
' AND entity_id = ?)',
$productId
);
if (count($where) >= self::ATTRIBUTE_DELETE_BUNCH) {
$this->_connection->delete($tableName, implode(' OR ', $where));
$where = [];
}
}
}
if (!empty($where)) {
$this->_connection->delete($tableName, implode(' OR ', $where));
}
$this->_connection->insertOnDuplicate($tableName, $tableData, ['value']);
}
return $this;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -504,18 +504,6 @@ public function testSaveProductAttributes()
$this->_connection->expects($this->any())
->method('quoteInto')
->willReturnCallback([$this, 'returnQuoteCallback']);
$this->_connection
->expects($this->once())
->method('delete')
->with(
$this->equalTo($testTable),
$this->equalTo(
'(store_id NOT IN ('
. $storeId . ') AND attribute_id = '
. $attributeId . ' AND entity_id = '
. self::ENTITY_ID . ')'
)
);

$tableData[] = [
'entity_id' => self::ENTITY_ID,
Expand Down

0 comments on commit 28709d5

Please sign in to comment.