From 9a9a1fc64cecdfd2782f4737c2958ac43ddb7766 Mon Sep 17 00:00:00 2001 From: Simon Hamp Date: Wed, 27 Apr 2022 04:00:14 +0100 Subject: [PATCH] Fix custom values --- src/Importer.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Importer.php b/src/Importer.php index 5a47bb7..90cb8dc 100644 --- a/src/Importer.php +++ b/src/Importer.php @@ -108,8 +108,8 @@ public function setMeta(array $meta): self public function getCustomValues($key = null) { - if ($key && ! empty($this->custom_values[$key])) { - return $this->custom_values[$key]; + if ($key) { + return $this->custom_values[$key] ?? ''; } return $this->custom_values; @@ -154,7 +154,7 @@ protected function getFieldValue(array $row, string $mapping, string $attribute) return $row[$mapping]; } elseif (Str::startsWith($mapping, 'meta')) { return $this->getMeta(Str::remove('@meta.', "@{$mapping}")); - } elseif (Str::startsWith($mapping, 'custom')) { + } elseif ($mapping === 'custom') { return $this->getCustomValues($attribute); } }