Skip to content

Commit

Permalink
Merge pull request #710 from akeneo/release/104.3.16
Browse files Browse the repository at this point in the history
PGTO-398: Do not create an empty value for visual and color swatch in…
  • Loading branch information
magentix authored Oct 24, 2024
2 parents 7c4ad05 + aa34142 commit 2ac5c3b
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -523,3 +523,6 @@
* PGTO-480: Fix request to match existing options
* Set default product name to empty instead of null
* Update UUID according sku configured column

### Version 104.3.16 :
* PGTO-398: Do not create an empty value for visual and color swatch in stores
7 changes: 4 additions & 3 deletions Job/Option.php
Original file line number Diff line number Diff line change
Expand Up @@ -556,12 +556,13 @@ public function insertSwatchOption(): void
$dataToInsert = [];

foreach ($swatchesAttributesData as $swatchesAttributeData) {
$optionTypeAndValue = $this->getTypeAndValue($swatchesAttributes, $swatchesAttributeData);
if ((int)$optionTypeAndValue['type'] === Swatch::SWATCH_TYPE_VISUAL_IMAGE &&
// Do not add value for visual and color swatch if store is not default
if ($swatchesAttributes[$swatchesAttributeData['attribute']] !== Swatch::SWATCH_TYPE_TEXTUAL_ATTRIBUTE_FRONTEND_INPUT &&
(int)$swatchesAttributeData['store_id'] !== 0)
{
continue;
}
$optionTypeAndValue = $this->getTypeAndValue($swatchesAttributes, $swatchesAttributeData);
$dataToInsert[] = [
'option_id' => $swatchesAttributeData['option_id'],
'store_id' => $swatchesAttributeData['store_id'],
Expand Down Expand Up @@ -596,7 +597,7 @@ public function getTypeAndValue(array $swatchesAttributes, array $swatchesAttrib
];
}

// Keep the current data for visual swatch
// Keep the current data for visual and color swatch
/** @var AdapterInterface $connection */
$connection = $this->entitiesHelper->getConnection();
$current = $connection->fetchRow(
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"nyholm/psr7": "^1.5"
},
"type": "magento2-module",
"version": "104.3.15",
"version": "104.3.16",
"license": [
"OSL-3.0",
"AFL-3.0"
Expand Down

0 comments on commit 2ac5c3b

Please sign in to comment.