From 399d6956d68b6210ea9768d7520cd5a778362154 Mon Sep 17 00:00:00 2001 From: Maxime Aveline Date: Tue, 19 Jul 2022 17:28:25 +0200 Subject: [PATCH 1/6] AKCOMAG2001-248: Require nyholm/psr7 package --- composer.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/composer.json b/composer.json index 19287753..d156f8dd 100644 --- a/composer.json +++ b/composer.json @@ -9,7 +9,8 @@ "magento/module-store": ">=100.0.1", "akeneo/api-php-client": "^9.0", "symfony/http-client": "^5", - "http-interop/http-factory-guzzle": "^1.0" + "http-interop/http-factory-guzzle": "^1.0", + "nyholm/psr7": "^1.5" }, "type": "magento2-module", "version": "103.0.3", From d5b3a6b6ae53b68bd191ad52ffacd486b654fc41 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Verri=C3=A8re?= Date: Wed, 20 Jul 2022 10:46:54 +0200 Subject: [PATCH 2/6] AKCOMAG2001-247: Add missing $edition variable --- Job/Product.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Job/Product.php b/Job/Product.php index 552d21c3..353cec92 100644 --- a/Job/Product.php +++ b/Job/Product.php @@ -2341,7 +2341,9 @@ public function linkSimple() /** @var Mysql $query */ $query = $connection->query($select); - + /** @var string $edition */ + $edition = $this->configHelper->getEdition(); + if ($edition === Edition::SERENITY || $edition === Edition::GROWTH) { /** @var string[] $filters */ $filters = [ From f3e53c76d3846fc924c65365732c38dce1e09003 Mon Sep 17 00:00:00 2001 From: Maxime Aveline Date: Thu, 21 Jul 2022 15:32:18 +0200 Subject: [PATCH 3/6] AKCOMAG2001-252: Remove "ghost" super attributes that exists into Magento but didn't into Akeneo into product flow --- Job/Product.php | 30 ++++++++++++++++++++++++++++-- 1 file changed, 28 insertions(+), 2 deletions(-) diff --git a/Job/Product.php b/Job/Product.php index 353cec92..069730b5 100644 --- a/Job/Product.php +++ b/Job/Product.php @@ -2198,10 +2198,36 @@ public function linkConfigurable() continue; } - /** @var array $attributes */ - $attributes = explode(',', $row['_axis'] ?? ''); /** @var int $position */ $position = 0; + /** @var array $attributes */ + $attributes = explode(',', $row['_axis'] ?? ''); + /** @var array $attributes */ + $attributes = explode(',', $row['_axis'] ?? ''); + /** @var array[] $productExistingSuperAttributes */ + $existingSuperAttributes = $connection->fetchAll( + $connection->select()->from($productSuperAttrTable, ['attribute_id'])->where( + 'product_id = ?', + $row[$pKeyColumn] + ) + ); + /** @var string[] $formattedExistingSuperAttributes */ + $formattedExistingSuperAttributes = array_map('current', $existingSuperAttributes); + + /** @var string $existingAttributeId */ + foreach ($formattedExistingSuperAttributes as $existingAttributeId) { + if (in_array($existingAttributeId, $attributes)) { + continue; + } + // Remove "ghost" super attributes that exists into Magento but didn't into Akeneo + $remove = $connection->delete( + $productSuperAttrTable, + [ + 'product_id = ?' => $row[$pKeyColumn], + 'attribute_id = ?' => $existingAttributeId, + ] + ); + } /** @var int $id */ foreach ($attributes as $id) { From 87bab8ef555551b4a55dac5c809126d299f35b0c Mon Sep 17 00:00:00 2001 From: Maxime Aveline Date: Thu, 21 Jul 2022 16:56:38 +0200 Subject: [PATCH 4/6] AKCOMAG2001-252: Remove duplicate $attributes variable --- Job/Product.php | 2 -- 1 file changed, 2 deletions(-) diff --git a/Job/Product.php b/Job/Product.php index 069730b5..c483cddd 100644 --- a/Job/Product.php +++ b/Job/Product.php @@ -2202,8 +2202,6 @@ public function linkConfigurable() $position = 0; /** @var array $attributes */ $attributes = explode(',', $row['_axis'] ?? ''); - /** @var array $attributes */ - $attributes = explode(',', $row['_axis'] ?? ''); /** @var array[] $productExistingSuperAttributes */ $existingSuperAttributes = $connection->fetchAll( $connection->select()->from($productSuperAttrTable, ['attribute_id'])->where( From 7b67c57c2b48733a92d72b9c9ccc67aba718622b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Verri=C3=A8re?= Date: Fri, 22 Jul 2022 15:16:44 +0200 Subject: [PATCH 5/6] AKCOMAG2001-235: Remove family name from temporary table name during setRelated step --- Job/Product.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Job/Product.php b/Job/Product.php index c483cddd..34e13fe0 100644 --- a/Job/Product.php +++ b/Job/Product.php @@ -2774,7 +2774,7 @@ public function setRelated(): void } // we create temp table to avoid FIND_IN_SET MySQL query which is a performance killer - $tempRelatedTable = 'tmp_akeneo_' . strtolower(__FUNCTION__) . '_' . ($this->family ?: uniqid()); + $tempRelatedTable = 'tmp_akeneo_' . strtolower(__FUNCTION__) . '_' . uniqid(); $tempRelatedTable = substr($tempRelatedTable, 0, AdapterMysql::LENGTH_TABLE_NAME); $connection->createTemporaryTable( $connection->newTable($tempRelatedTable) From a4c30db791adeded5c700cf7a6e7c246e643db1d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Verri=C3=A8re?= Date: Mon, 25 Jul 2022 11:24:34 +0200 Subject: [PATCH 6/6] v103.0.4: Add version 103.0.4 changelog and bump composer.json version --- CHANGELOG.md | 6 ++++++ composer.json | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index cb2ef972..6c4036b7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -355,3 +355,9 @@ ### Version 103.0.3 : * Fix simple product association with configurable product when a variation from a two-level family variant is imported without the product model + +### Version 103.0.4 : +* Fix "setRelated" temporary table name to unique value +* Fix product model variant change in `catalog_product_super_attribute` table +* Fix `Too few arguments to function Laminas\Diactoros\ResponseFactory::__construct()` issue by adding `nyholm/psr7` dependency +* Fix missing "$edition" variable in `Job/Product.php` diff --git a/composer.json b/composer.json index d156f8dd..4ea8e037 100644 --- a/composer.json +++ b/composer.json @@ -13,7 +13,7 @@ "nyholm/psr7": "^1.5" }, "type": "magento2-module", - "version": "103.0.3", + "version": "103.0.4", "license": [ "OSL-3.0", "AFL-3.0"