From c149885ceb07fd2b37be5902d9f95048ad38c4a3 Mon Sep 17 00:00:00 2001 From: snipe Date: Sun, 16 Apr 2023 07:47:04 -0700 Subject: [PATCH] =?UTF-8?q?Skip=20the=20magical=20user=20creation=20if=20i?= =?UTF-8?q?t=E2=80=99s=20a=20location?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: snipe --- app/Importer/ItemImporter.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/app/Importer/ItemImporter.php b/app/Importer/ItemImporter.php index 7848ec6b85..f989457dc6 100644 --- a/app/Importer/ItemImporter.php +++ b/app/Importer/ItemImporter.php @@ -60,8 +60,8 @@ class ItemImporter extends Importer $this->item['department_id'] = $this->createOrFetchDepartment($item_department); } - $item_manager_first_name = $this->findCsvMatch($row, 'manage_first_name'); - $item_manager_last_name = $this->findCsvMatch($row, 'manage_last_name'); + $item_manager_first_name = $this->findCsvMatch($row, 'manager_first_name'); + $item_manager_last_name = $this->findCsvMatch($row, 'manager_last_name'); if ($this->shouldUpdateField($item_manager_first_name)) { $this->item['manager_id'] = $this->fetchManager($item_manager_first_name, $item_manager_last_name); @@ -112,6 +112,10 @@ class ItemImporter extends Importer 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'))); }