Skip to content

Commit

Permalink
Merge pull request #249 from Nosto/hotfix/2.4.9
Browse files Browse the repository at this point in the history
Add a null guard or getting custom fields configuration
  • Loading branch information
Hannu Pölönen authored Sep 23, 2020
2 parents 4b82c20 + 4a88088 commit ebf2a67
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 10 deletions.
2 changes: 1 addition & 1 deletion Bootstrap.php
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
19 changes: 11 additions & 8 deletions Components/Helper/CustomFields.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down

0 comments on commit ebf2a67

Please sign in to comment.