Check for status_id key - related to #3928

TODO: Fix for model number
This commit is contained in:
snipe 2017-09-08 17:24:28 -07:00
parent 4e7a6c0ccf
commit 6c283de60a

View file

@ -63,7 +63,9 @@ class AssetImporter extends ItemImporter
$this->item['image'] = $this->findCsvMatch($row, "image");
$this->item['warranty_months'] = intval($this->findCsvMatch($row, "warranty"));
$this->item['model_id'] = $this->createOrFetchAssetModel($row);
if (!$this->item['status_id'] && !$editingAsset) {
// If no status ID is found
if (!array_key_exists('status_id', $this->item) && !$editingAsset) {
$this->log("No status field found, defaulting to first status.");
$this->item['status_id'] = $this->defaultStatusLabelId;
}