Skip to content

Commit ecf4680

Browse files
committed
AC-2904-v1:: Saving product with non-default store scope causes untouched attributes to become store scoped if loaded using ProductRepository
1 parent d9fd94c commit ecf4680

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

app/code/Magento/Catalog/Model/ProductRepository.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -525,6 +525,7 @@ public function save(ProductInterface $product, $saveOptions = false)
525525
{
526526
$assignToCategories = false;
527527
$tierPrices = $product->getData('tier_price');
528+
$productDataToChange = $product->getData();
528529

529530
try {
530531
$existingProduct = $product->getId() ?
@@ -600,6 +601,7 @@ public function save(ProductInterface $product, $saveOptions = false)
600601
$attributeCode = $attribute->getAttributeCode();
601602
$value = $product->getData($attributeCode);
602603
if ($existingProduct->getData($attributeCode) === $value
604+
&& $existingProduct->getOrigData($attributeCode) === $value
603605
&& $attribute->getScope() !== EavAttributeInterface::SCOPE_GLOBAL_TEXT
604606
&& !is_array($value)
605607
&& !$attribute->isStatic()

0 commit comments

Comments
 (0)