Skip to content

Commit

Permalink
fix: enabed prop cannot be null
Browse files Browse the repository at this point in the history
  • Loading branch information
Thijzer committed Nov 10, 2023
1 parent 0228286 commit 99d7bb9
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions src/Component/Converter/Akeneo/Csv/Product.php
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit 99d7bb9

Please sign in to comment.