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

This commit is contained in:
Daniel Meltzer 2018-01-20 11:40:01 -05:00 committed by snipe
parent a28fee1ff4
commit 6bf17e7d47

View file

@ -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);