Skip to content

Commit b65c12e

Browse files
committed
Do an empty check instead of isset check on image removed
In some cases the 'removed' tag on the image is already set to an empty string in the data which will be loaded. Therefore the isset check fails which clears the image roles. On all other cases where this 'removed' tag is being validated with an empty or !empty. Therefor it seems safe to apply this here also.
1 parent 93f21ca commit b65c12e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

app/code/Magento/Catalog/Model/ProductRepository/MediaGalleryProcessor.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -231,7 +231,7 @@ private function processEntries(ProductInterface $product, array $newEntries, ar
231231
private function processMediaAttributes(ProductInterface $product, array $images): void
232232
{
233233
foreach ($images as $image) {
234-
if (!isset($image['removed']) && !empty($image['types'])) {
234+
if (empty($image['removed']) && !empty($image['types'])) {
235235
$this->processor->setMediaAttribute($product, $image['types'], $image['file']);
236236
}
237237
}

0 commit comments

Comments
 (0)