From b492a3e45e33e6b286f76bc6bb91f3d7a0657dde Mon Sep 17 00:00:00 2001 From: Duncan McClean Date: Tue, 10 Dec 2024 12:25:15 +0000 Subject: [PATCH] Fix error when importing structured collection without mapping parents (#58) --- src/Jobs/UpdateCollectionTreeJob.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/Jobs/UpdateCollectionTreeJob.php b/src/Jobs/UpdateCollectionTreeJob.php index f129873..c2085fb 100644 --- a/src/Jobs/UpdateCollectionTreeJob.php +++ b/src/Jobs/UpdateCollectionTreeJob.php @@ -30,6 +30,10 @@ public function handle(): void return; } + if (! Cache::has("importer.{$this->import->id}.parents")) { + return; + } + $parents = (new SortByParent)->sort(Cache::get("importer.{$this->import->id}.parents")); collect($parents)->each(function (array $item) use ($tree) {