Skip to content

Commit efb6455

Browse files
author
Hayder Sharhan
committed
MAGETWO-56868: CLONE - Cannot save a product with images for the second time
- Fixed image merging problem.
1 parent 25b6600 commit efb6455

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

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

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1468,7 +1468,10 @@ public function getMediaGalleryImages()
14681468
if (!$this->hasData('media_gallery_images') && is_array($this->getMediaGallery('images'))) {
14691469
$images = $this->_collectionFactory->create();
14701470
foreach ($this->getMediaGallery('images') as $image) {
1471-
if ((isset($image['disabled']) && $image['disabled']) || empty($image['value_id'])) {
1471+
if ((isset($image['disabled']) && $image['disabled'])
1472+
|| empty($image['value_id'])
1473+
|| $images->getItemById($image['value_id']) != null
1474+
) {
14721475
continue;
14731476
}
14741477
$image['url'] = $this->getMediaConfig()->getMediaUrl($image['file']);

0 commit comments

Comments
 (0)