diff --git a/Bootstrap.php b/Bootstrap.php index 20ae54f5..21cb3db6 100644 --- a/Bootstrap.php +++ b/Bootstrap.php @@ -86,7 +86,7 @@ class Shopware_Plugins_Frontend_NostoTagging_Bootstrap extends Shopware_Components_Plugin_Bootstrap { const PLATFORM_NAME = 'shopware'; - const PLUGIN_VERSION = '2.4.8'; + const PLUGIN_VERSION = '2.4.9'; const MENU_PARENT_ID = 23; // Configuration const NEW_ENTITY_MANAGER_VERSION = '5.0.0'; const NEW_ATTRIBUTE_MANAGER_VERSION = '5.2.0'; diff --git a/CHANGELOG.md b/CHANGELOG.md index be92adde..4060ab82 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,9 @@ All notable changes to this project will be documented in this file. This project adheres to [Semantic Versioning](http://semver.org/). +## 2.4.9 +- Add null guard for fetching custom fields configuration for a product + ## 2.4.8 - Prevent Shopware's full page cache to cache Nosto tagging blocks diff --git a/Components/Helper/CustomFields.php b/Components/Helper/CustomFields.php index f7af63c8..a88d9cac 100644 --- a/Components/Helper/CustomFields.php +++ b/Components/Helper/CustomFields.php @@ -80,15 +80,18 @@ public static function getDetailSettingsCustomFields(Detail $detail) $settingsCustomFields = array(); // Add variant configuration group options into custom attributes try { - $configurator = $detail->getConfiguratorOptions()->getValues(); - foreach ($configurator as $config) { - /** @var Option $config */ - if (!$config instanceof Option - || $config->getGroup() === null - ) { - continue; + $configuratorOptions = $detail->getConfiguratorOptions(); + if ($configuratorOptions !== null) { + $configurator = $configuratorOptions->getValues(); + foreach ($configurator as $config) { + /** @var Option $config */ + if (!$config instanceof Option + || $config->getGroup() === null + ) { + continue; + } + $settingsCustomFields[$config->getGroup()->getName()] = $config->getName(); } - $settingsCustomFields[$config->getGroup()->getName()] = $config->getName(); } } catch (\Exception $e) { /** @noinspection PhpUndefinedMethodInspection */ diff --git a/composer.json b/composer.json index 69c87be1..214aa5bf 100644 --- a/composer.json +++ b/composer.json @@ -4,7 +4,7 @@ "license": [ "BSD-3-Clause" ], - "version": "2.4.8", + "version": "2.4.9", "require": { "php": ">=5.4.0", "nosto/php-sdk": "3.15.0"