mirror of
https://github.com/snipe/snipe-it.git
synced 2025-01-12 06:17:28 -08:00
Check if there are any custom fields before trying to loop through them
This commit is contained in:
parent
4b84a0c916
commit
6517a95d45
|
@ -23,14 +23,18 @@ class AssetImporter extends ItemImporter
|
||||||
// ItemImporter handles the general fetching.
|
// ItemImporter handles the general fetching.
|
||||||
parent::handle($row);
|
parent::handle($row);
|
||||||
|
|
||||||
foreach ($this->customFields as $customField) {
|
if ($this->customFields) {
|
||||||
$customFieldValue = $this->array_smart_custom_field_fetch($row, $customField);
|
|
||||||
if ($customFieldValue) {
|
foreach ($this->customFields as $customField) {
|
||||||
$this->item['custom_fields'][$customField->db_column_name()] = $customFieldValue;
|
$customFieldValue = $this->array_smart_custom_field_fetch($row, $customField);
|
||||||
$this->log('Custom Field '. $customField->name.': '.$customFieldValue);
|
if ($customFieldValue) {
|
||||||
|
$this->item['custom_fields'][$customField->db_column_name()] = $customFieldValue;
|
||||||
|
$this->log('Custom Field '. $customField->name.': '.$customFieldValue);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
$this->createAssetIfNotExists($row);
|
$this->createAssetIfNotExists($row);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue