From 99d7bb9d94be813ad626d74331b799b77e74f0a6 Mon Sep 17 00:00:00 2001 From: Thijs De Paepe Date: Fri, 10 Nov 2023 13:31:01 +0100 Subject: [PATCH] fix: enabed prop cannot be null --- src/Component/Converter/Akeneo/Csv/Product.php | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/src/Component/Converter/Akeneo/Csv/Product.php b/src/Component/Converter/Akeneo/Csv/Product.php index 05c9d61c..8c6caf3e 100644 --- a/src/Component/Converter/Akeneo/Csv/Product.php +++ b/src/Component/Converter/Akeneo/Csv/Product.php @@ -139,10 +139,18 @@ public function revert(array $item): array $output = []; $output['sku'] = $item['sku'] ?? $item['identifier'] ?? null; - $output['enabled'] = $item['enabled'] ?? null; - $output['family'] = $item['family'] ?? null; - $output['categories'] = $item['categories'] ?? null; - $output['parent'] = $item['parent'] ?? null; + if (isset($item['enabled'])) { + $output['enabled'] = $item['enabled']; + } + if (array_key_exists($item['family'])) { + $output['family'] = $item['family']; + } + if (array_key_exists($item['categories'])) { + $output['categories'] = $item['categories']; + } + if (array_key_exists($item['parent'])) { + $output['parent'] = $item['parent']; + } $output = $this->decoder->decode($output); foreach ($item as $key => $itemValue) {