Skip to content

Commit cb4e085

Browse files
committed
ACP2E-1522: Auto increment number jumping up for catalog_product_entity_* tables
- Fixed the integration and web api test build failure.
1 parent 33dba86 commit cb4e085

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

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

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -229,13 +229,17 @@ protected function _saveAttributeValue($object, $attribute, $value)
229229
$whereArr[] = $connection->quoteInto($field . '=?', $value);
230230
}
231231
$where = implode(' AND ', $whereArr);
232-
$select = $connection->select()->from($table, ['value_id', 'value'])->where($where);
232+
$select = $connection->select()->from($table, ['value_id', 'value', 'store_id'])->where($where);
233233
$origRow = $connection->fetchRow($select);
234234
$origValueId = $origRow['value_id'] ?? false;
235+
$origStoreId = (int) $origRow['store_id'] ?? 0;
235236
$storeIds = $this->_storeManager->getStore($storeId)->getWebsite()->getStoreIds(true);
236237

237238
if ($origValueId > 0 && count($storeIds) === 1) {
238239
$data->setData('value_id', $origValueId);
240+
if ($storeId !== $origStoreId) {
241+
$data->setData('store_id', $origStoreId);
242+
}
239243
}
240244

241245
$bind = $this->_prepareDataForTable($data, $table);

0 commit comments

Comments
 (0)