Skip to content

Commit b0eea2e

Browse files
committed
MAGETWO-57397: Update gallery entry via API doesn't work - for mainline
1 parent 7d0e3b2 commit b0eea2e

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

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

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,9 @@ public function update($sku, ProductAttributeMediaGalleryEntryInterface $entry)
9696
foreach ($existingMediaGalleryEntries as $key => $existingEntry) {
9797
if ($existingEntry->getId() == $entry->getId()) {
9898
$found = true;
99-
$entry->setId(null);
99+
if ($entry->getFile()) {
100+
$entry->setId(null);
101+
}
100102
$existingMediaGalleryEntries[$key] = $entry;
101103
break;
102104
}

0 commit comments

Comments
 (0)