From 2eb34d423f06ca85c6ea8f6135e089de9a71d7f9 Mon Sep 17 00:00:00 2001 From: Brady Wetherington Date: Tue, 16 May 2023 16:33:07 -0700 Subject: [PATCH] Importer fix for non-Location imports --- app/Importer/ItemImporter.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/app/Importer/ItemImporter.php b/app/Importer/ItemImporter.php index f989457dc..8e5cfbb16 100644 --- a/app/Importer/ItemImporter.php +++ b/app/Importer/ItemImporter.php @@ -103,19 +103,19 @@ class ItemImporter extends Importer /** * Parse row to determine what (if anything) we should checkout to. * @param array $row CSV Row being parsed - * @return SnipeModel Model to be checked out to + * @return ?SnipeModel Model to be checked out to */ protected function determineCheckout($row) { + if (get_class($this) == LocationImporter::class) { + return; + } + // We only support checkout-to-location for asset, so short circuit otherwise. if (get_class($this) != AssetImporter::class) { return $this->createOrFetchUser($row); } - if (get_class($this) != LocationImporter::class) { - return; - } - if (strtolower($this->item['checkout_class']) === 'location' && $this->findCsvMatch($row, 'checkout_location') != null ) { return Location::findOrFail($this->createOrFetchLocation($this->findCsvMatch($row, 'checkout_location'))); }