From 6bf17e7d47ff21e9c88e7b773b0ad32ea063bb74 Mon Sep 17 00:00:00 2001 From: Daniel Meltzer Date: Sat, 20 Jan 2018 11:40:01 -0500 Subject: [PATCH] Reset the item between rows of import to avoid stale data. (#4868) --- app/Importer/ItemImporter.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/app/Importer/ItemImporter.php b/app/Importer/ItemImporter.php index 09e7d5b155..72a618cbd1 100644 --- a/app/Importer/ItemImporter.php +++ b/app/Importer/ItemImporter.php @@ -22,6 +22,9 @@ class ItemImporter extends Importer protected function handle($row) { + // Need to reset this between iterations or we'll have stale data. + $this->item = []; + $item_category = $this->findCsvMatch($row, "category"); if ($this->shouldUpdateField($item_category)) { $this->item["category_id"] = $this->createOrFetchCategory($item_category);