Skip to content

Commit

Permalink
Fix PHP Notice when gallery is missing
Browse files Browse the repository at this point in the history
  • Loading branch information
jissereitsma committed Jun 24, 2021
1 parent 1b83465 commit a0e31cf
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 1 deletion.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

## [0.10.9] - 24 June 2021
- Fix PHP Notice when gallery is missing

## [0.10.8] - 24 June 2021
- Allow configuring convertors (#77)

Expand Down
4 changes: 4 additions & 0 deletions Plugin/AddWebpToSwatchesAjaxData.php
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,10 @@ public function afterGetProductMediaGallery(SwatchesDataHelper $subject, array $
$images[$type . '_webp'] = $this->getWebpUrl($images[$type]);
}

if (!isset($images['gallery'])) {
return $images;
}

foreach ($images['gallery'] as $galleryIndex => $galleryImages) {
foreach ($types as $type) {
if (!isset($images[$type])) {
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "yireo/magento2-webp2",
"license": "OSL-3.0",
"version": "0.10.8",
"version": "0.10.9",
"type": "magento2-module",
"homepage": "https://www.yireo.com/software/magento-extensions/webp2",
"description": "Magento 2 module to add WebP support to the Magento frontend",
Expand Down

0 comments on commit a0e31cf

Please sign in to comment.