Skip to content

A free open source IT asset/license management system

Reset the item between rows of import to avoid stale data. (#4868)

Daniel Meltzer6bf17e7d47ff
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);