Skip to content

Commit

Permalink
馃悰 add default image group name if image set name is missing (#142)
Browse files Browse the repository at this point in the history
  • Loading branch information
gengjozsef committed Nov 7, 2023
1 parent 6cf6686 commit 6e00a41
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,11 @@
*/
class ProductImageGroupedPageDataLoaderExpanderPlugin extends AbstractPlugin implements ProductPageDataExpanderPluginInterface
{
/**
* @var string
*/
protected const IMAGE_GROUP_NAME_EMPTY = '*';

/**
* {@inheritDoc}
*
Expand All @@ -39,7 +44,7 @@ public function expandProductPageData(array $productData, ProductPageSearchTrans
foreach ($imageSetsByLocale as $imageSet) {
foreach ($productImages as $productImage) {
if ($productImage['fk_product_image_set'] === $imageSet->getIdProductImageSet()) {
$regrouped[$imageSet->getName()][] = $productImage;
$regrouped[($imageSet->getName() ?? static::IMAGE_GROUP_NAME_EMPTY)][] = $productImage;
}
}
}
Expand Down

0 comments on commit 6e00a41

Please sign in to comment.