@@ -525,7 +525,6 @@ public function save(ProductInterface $product, $saveOptions = false)
525525 {
526526 $ assignToCategories = false ;
527527 $ tierPrices = $ product ->getData ('tier_price ' );
528- $ productDataToChange = $ product ->getData ();
529528
530529 try {
531530 $ existingProduct = $ product ->getId () ?
@@ -597,10 +596,12 @@ public function save(ProductInterface $product, $saveOptions = false)
597596 && $ product ->getStoreId () !== Store::DEFAULT_STORE_ID
598597 && (count ($ stores ) > 1 || count ($ websites ) === 1 )
599598 ) {
599+ $ imageRoles = ['image ' , 'small_image ' , 'thumbnail ' ];
600600 foreach ($ productAttributes as $ attribute ) {
601601 $ attributeCode = $ attribute ->getAttributeCode ();
602602 $ value = $ product ->getData ($ attributeCode );
603- if ($ existingProduct ->getData ($ attributeCode ) === $ value
603+ if (!in_array ($ attributeCode , $ imageRoles )
604+ && $ existingProduct ->getData ($ attributeCode ) === $ value
604605 && $ existingProduct ->getOrigData ($ attributeCode ) === $ value
605606 && $ attribute ->getScope () !== EavAttributeInterface::SCOPE_GLOBAL_TEXT
606607 && !is_array ($ value )
@@ -627,7 +628,6 @@ public function save(ProductInterface $product, $saveOptions = false)
627628 }
628629
629630 $ this ->saveProduct ($ product );
630-
631631 if ($ assignToCategories === true && $ product ->getCategoryIds ()) {
632632 $ this ->linkManagement ->assignProductToCategories (
633633 $ product ->getSku (),
0 commit comments