Skip to content

Commit 0667cdb

Browse files
author
Bohdan Korablov
committed
MAGETWO-60908: Image role can't be updated
1 parent 8f5bb6a commit 0667cdb

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

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

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -96,8 +96,7 @@ public function update($sku, ProductAttributeMediaGalleryEntryInterface $entry)
9696
foreach ($existingMediaGalleryEntries as $key => $existingEntry) {
9797
$entryTypes = (array)$entry->getTypes();
9898
$existingEntryTypes = (array)$existingMediaGalleryEntries[$key]->getTypes();
99-
$intersectEntryTypes = array_intersect($entryTypes, $existingEntryTypes);
100-
$existingMediaGalleryEntries[$key]->setTypes(array_diff($existingEntryTypes, $intersectEntryTypes));
99+
$existingMediaGalleryEntries[$key]->setTypes(array_diff($existingEntryTypes, $entryTypes));
101100

102101
if ($existingEntry->getId() == $entry->getId()) {
103102
$found = true;

0 commit comments

Comments
 (0)