Skip to content
Snippets Groups Projects
Commit 0667cdb6 authored by Bohdan Korablov's avatar Bohdan Korablov
Browse files

MAGETWO-60908: Image role can't be updated

parent 8f5bb6aa
Branches
No related merge requests found
...@@ -96,8 +96,7 @@ class GalleryManagement implements \Magento\Catalog\Api\ProductAttributeMediaGal ...@@ -96,8 +96,7 @@ class GalleryManagement implements \Magento\Catalog\Api\ProductAttributeMediaGal
foreach ($existingMediaGalleryEntries as $key => $existingEntry) { foreach ($existingMediaGalleryEntries as $key => $existingEntry) {
$entryTypes = (array)$entry->getTypes(); $entryTypes = (array)$entry->getTypes();
$existingEntryTypes = (array)$existingMediaGalleryEntries[$key]->getTypes(); $existingEntryTypes = (array)$existingMediaGalleryEntries[$key]->getTypes();
$intersectEntryTypes = array_intersect($entryTypes, $existingEntryTypes); $existingMediaGalleryEntries[$key]->setTypes(array_diff($existingEntryTypes, $entryTypes));
$existingMediaGalleryEntries[$key]->setTypes(array_diff($existingEntryTypes, $intersectEntryTypes));
if ($existingEntry->getId() == $entry->getId()) { if ($existingEntry->getId() == $entry->getId()) {
$found = true; $found = true;
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment