@@ -525,7 +525,6 @@ public function save(ProductInterface $product, $saveOptions = false)
525
525
{
526
526
$ assignToCategories = false ;
527
527
$ tierPrices = $ product ->getData ('tier_price ' );
528
- $ productDataToChange = $ product ->getData ();
529
528
530
529
try {
531
530
$ existingProduct = $ product ->getId () ?
@@ -597,10 +596,12 @@ public function save(ProductInterface $product, $saveOptions = false)
597
596
&& $ product ->getStoreId () !== Store::DEFAULT_STORE_ID
598
597
&& (count ($ stores ) > 1 || count ($ websites ) === 1 )
599
598
) {
599
+ $ imageRoles = ['image ' , 'small_image ' , 'thumbnail ' ];
600
600
foreach ($ productAttributes as $ attribute ) {
601
601
$ attributeCode = $ attribute ->getAttributeCode ();
602
602
$ value = $ product ->getData ($ attributeCode );
603
- if ($ existingProduct ->getData ($ attributeCode ) === $ value
603
+ if (!in_array ($ attributeCode , $ imageRoles )
604
+ && $ existingProduct ->getData ($ attributeCode ) === $ value
604
605
&& $ existingProduct ->getOrigData ($ attributeCode ) === $ value
605
606
&& $ attribute ->getScope () !== EavAttributeInterface::SCOPE_GLOBAL_TEXT
606
607
&& !is_array ($ value )
@@ -627,7 +628,6 @@ public function save(ProductInterface $product, $saveOptions = false)
627
628
}
628
629
629
630
$ this ->saveProduct ($ product );
630
-
631
631
if ($ assignToCategories === true && $ product ->getCategoryIds ()) {
632
632
$ this ->linkManagement ->assignProductToCategories (
633
633
$ product ->getSku (),
0 commit comments