Skip to content

Commit

Permalink
Fix custom values
Browse files Browse the repository at this point in the history
  • Loading branch information
simonhamp committed Apr 27, 2022
1 parent 2de318e commit 9a9a1fc
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/Importer.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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);
}
}
Expand Down

0 comments on commit 9a9a1fc

Please sign in to comment.