From 28e000cdb371b7ed8840a82db1cb7b5b9a41cf02 Mon Sep 17 00:00:00 2001 From: Marvin Besselsen Date: Thu, 11 Apr 2024 13:49:32 +0200 Subject: [PATCH 1/5] Empty parentRelations fallback returns full product collection #222 --- Model/Collection/Products.php | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/Model/Collection/Products.php b/Model/Collection/Products.php index 207a293..b04d4f9 100755 --- a/Model/Collection/Products.php +++ b/Model/Collection/Products.php @@ -385,10 +385,7 @@ public function joinPriceIndexLeft($collection, $websiteId) */ public function getParents($parentRelations, $config): ProductCollection { - if (empty($parentRelations)) { - return $this->productCollection; //return empty product collection - } - + $parentRelations = $parentRelations ?: [0]; $filters = $config['filters']; if (!$config['flat']) { From dc96d08b6d36051d2da42ba53757ba3873db5ce8 Mon Sep 17 00:00:00 2001 From: Marvin Besselsen Date: Thu, 11 Apr 2024 13:50:04 +0200 Subject: [PATCH 2/5] Fixed issue with empty inventory on item updates --- Model/Item.php | 1 + 1 file changed, 1 insertion(+) diff --git a/Model/Item.php b/Model/Item.php index 5d22648..827439d 100644 --- a/Model/Item.php +++ b/Model/Item.php @@ -333,6 +333,7 @@ public function getProductData($items, $config): array try { $productIds = $this->itemHelper->getProductIdsFromCollection($items); $products = $this->productModel->getCollection($config, '', $productIds); + $this->productHelper->getInventoryData()->load($products->getColumnValues('sku'), $config); $parentRelations = $this->productHelper->getParentsFromCollection($products, $config); $parents = $this->productModel->getParents($parentRelations, $config); From 460ac7d24cf29d55aad05b11ec6dcc947d090e00 Mon Sep 17 00:00:00 2001 From: Marvin Besselsen Date: Thu, 11 Apr 2024 13:50:39 +0200 Subject: [PATCH 3/5] Simple products associated with 2 configurables are not exported #200 --- Model/Generate.php | 4 ++-- Model/Item.php | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Model/Generate.php b/Model/Generate.php index a7657b8..63f3694 100644 --- a/Model/Generate.php +++ b/Model/Generate.php @@ -136,8 +136,8 @@ public function generateByStore( $parent = null; if (!empty($parentRelations[$product->getEntityId()])) { foreach ($parentRelations[$product->getEntityId()] as $parentId) { - if ($parent = $parents->getItemById($parentId)) { - continue; + if ($foundParent = $parents->getItemById($parentId)) { + $parent = $foundParent; } } } diff --git a/Model/Item.php b/Model/Item.php index 827439d..25bf7c4 100644 --- a/Model/Item.php +++ b/Model/Item.php @@ -343,8 +343,8 @@ public function getProductData($items, $config): array if (!empty($parentRelations[$product->getEntityId()])) { foreach ($parentRelations[$product->getEntityId()] as $parentId) { /** @var Product $parent */ - if ($parent = $parents->getItemById($parentId)) { - continue; + if ($foundParent = $parents->getItemById($parentId)) { + $parent = $foundParent; } } } From a841d8daa7d2d305849ed5de99b2a392b5c118ee Mon Sep 17 00:00:00 2001 From: Marvin Besselsen Date: Thu, 11 Apr 2024 13:51:17 +0200 Subject: [PATCH 4/5] Handle empty values for name in Channable order grid --- Ui/Component/Listing/Column/Order/AbstractOrder.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/Ui/Component/Listing/Column/Order/AbstractOrder.php b/Ui/Component/Listing/Column/Order/AbstractOrder.php index 0c32b14..32e8b25 100644 --- a/Ui/Component/Listing/Column/Order/AbstractOrder.php +++ b/Ui/Component/Listing/Column/Order/AbstractOrder.php @@ -48,19 +48,19 @@ public function __construct( } /** - * Returs imploded customer name + * Returns imploded customer name * * @param array $data * @return string */ - public function getCustomerName($data): string + public function getCustomerName(array $data): string { return implode( ' ', [ - $data['first_name'], - $data['middle_name'], - $data['last_name'], + $data['first_name'] ?? '-', + $data['middle_name'] ?? '', + $data['last_name'] ?? '-', ] ); } From 8e42d6362835672821dad4d2f2de4e54a96b1bab Mon Sep 17 00:00:00 2001 From: Marvin Besselsen Date: Thu, 11 Apr 2024 13:51:30 +0200 Subject: [PATCH 5/5] Version bump --- composer.json | 2 +- etc/config.xml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/composer.json b/composer.json index 524389a..de18cf7 100755 --- a/composer.json +++ b/composer.json @@ -2,7 +2,7 @@ "name": "magmodules/magento2-channable", "description": "Channable integration for Magento 2", "type": "magento2-module", - "version": "1.18.1", + "version": "1.18.2", "license": "BSD-2-Clause", "homepage": "https://github.com/magmodules/magento2-channable", "require": { diff --git a/etc/config.xml b/etc/config.xml index b4f2519..ba8f0f0 100644 --- a/etc/config.xml +++ b/etc/config.xml @@ -12,7 +12,7 @@ 0 250 - v1.18.1 + v1.18.2 name