Skip to content

Commit 03e7b1d

Browse files
daunryanmitchell
andauthored
Filter taxonomies before importing (#297)
Co-authored-by: Ryan Mitchell <ryan@thoughtcollective.com>
1 parent b85057d commit 03e7b1d

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

src/Jobs/ImportSingleProductJob.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -374,6 +374,7 @@ private function importTaxonomy(array $tags, string $taxonomyHandle)
374374

375375
// 'Tag foo, Tag bar' => ['tag-foo' => 'Tag foo', 'tag-bar' => 'Tag bar']
376376
$tags = collect($tags)
377+
->filter()
377378
->mapWithKeys(fn ($tagTitle) => [Str::slug($tagTitle) => $tagTitle])
378379
->each(function ($tagTitle, $tagSlug) use ($taxonomyHandle) {
379380
$term = Term::query()

0 commit comments

Comments
 (0)