Skip to content

Commit 33dba86

Browse files
committed
ACP2E-1522: Auto increment number jumping up for catalog_product_entity_* tables
- Fixed the build failures.
1 parent a121baf commit 33dba86

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

app/code/Magento/Catalog/Model/ResourceModel/AbstractResource.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -232,8 +232,9 @@ protected function _saveAttributeValue($object, $attribute, $value)
232232
$select = $connection->select()->from($table, ['value_id', 'value'])->where($where);
233233
$origRow = $connection->fetchRow($select);
234234
$origValueId = $origRow['value_id'] ?? false;
235+
$storeIds = $this->_storeManager->getStore($storeId)->getWebsite()->getStoreIds(true);
235236

236-
if ($origValueId > 0) {
237+
if ($origValueId > 0 && count($storeIds) === 1) {
237238
$data->setData('value_id', $origValueId);
238239
}
239240

@@ -248,7 +249,6 @@ protected function _saveAttributeValue($object, $attribute, $value)
248249
/**
249250
* Update attribute value for website
250251
*/
251-
$storeIds = $this->_storeManager->getStore($storeId)->getWebsite()->getStoreIds(true);
252252
foreach ($storeIds as $storeId) {
253253
$bind['store_id'] = (int) $storeId;
254254
$this->_attributeValuesToSave[$table][] = $bind;

0 commit comments

Comments
 (0)