Skip to content

Commit e2422ce

Browse files
authored
Merge pull request #69 from magento-commerce/MCLOUD-10032
MCLOUD-10032: Added ACSD-49067 patch
2 parents 31fb0ae + c1637cb commit e2422ce

File tree

2 files changed

+51
-0
lines changed

2 files changed

+51
-0
lines changed

patches.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -264,6 +264,9 @@
264264
},
265265
"Fixed currency displaying on product page": {
266266
">=2.4.3 <2.4.4": "MCLOUD-8279__Fixed_currency_displaying_on_product_page__2.4.3.patch"
267+
},
268+
"Auto increment number jumping up for catalog_product_entity_* tables": {
269+
">=2.3.7 <2.4.7": "MCLOUD-10032__Increment_number_for_catalog_product_entity_tables__2.4.3-p1.patch"
267270
}
268271
},
269272
"magento/module-paypal": {
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
diff -Nuar a/vendor/magento/module-catalog/Model/ResourceModel/AbstractResource.php b/vendor/magento/module-catalog/Model/ResourceModel/AbstractResource.php
2+
index c71225b4fc6..3f0ee96d70e 100644
3+
--- a/vendor/magento/module-catalog/Model/ResourceModel/AbstractResource.php
4+
+++ b/vendor/magento/module-catalog/Model/ResourceModel/AbstractResource.php
5+
@@ -24,14 +24,14 @@ use Magento\Eav\Model\Entity\Attribute\UniqueValidationInterface;
6+
abstract class AbstractResource extends \Magento\Eav\Model\Entity\AbstractEntity
7+
{
8+
/**
9+
- * Store manager
10+
+ * Store manager to get the store information
11+
*
12+
* @var \Magento\Store\Model\StoreManagerInterface
13+
*/
14+
protected $_storeManager;
15+
16+
/**
17+
- * Model factory
18+
+ * Model factory to create a model object
19+
*
20+
* @var \Magento\Catalog\Model\Factory
21+
*/
22+
@@ -325,7 +325,25 @@ abstract class AbstractResource extends \Magento\Eav\Model\Entity\AbstractEntity
23+
*/
24+
protected function _updateAttribute($object, $attribute, $valueId, $value)
25+
{
26+
- return $this->_saveAttributeValue($object, $attribute, $value);
27+
+ $entity = $attribute->getEntity();
28+
+ $row = $this->getAttributeRow($entity, $object, $attribute);
29+
+ $hasSingleStore = $this->_storeManager->hasSingleStore();
30+
+ $storeId = $hasSingleStore
31+
+ ? $this->getDefaultStoreId()
32+
+ : (int) $this->_storeManager->getStore($object->getStoreId())->getId();
33+
+ if ($valueId > 0 && array_key_exists('store_id', $row) && $storeId === $row['store_id']) {
34+
+ $table = $attribute->getBackend()->getTable();
35+
+ $connection = $this->getConnection();
36+
+ $connection->update(
37+
+ $table,
38+
+ ['value' => $this->_prepareValueForSave($value, $attribute)],
39+
+ sprintf('%s=%d', $connection->quoteIdentifier('value_id'), $valueId)
40+
+ );
41+
+
42+
+ return $this;
43+
+ } else {
44+
+ return $this->_saveAttributeValue($object, $attribute, $value);
45+
+ }
46+
}
47+
48+
/**

0 commit comments

Comments
 (0)