Merge pull request #11615 from inietov/fixes/autoincrement_in_importer

Fix auto incrementing in CSV importer [sc-19366]
This commit is contained in:
snipe 2022-08-03 17:50:23 -07:00 committed by GitHub
commit 5f93d7b3be
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -55,6 +55,11 @@ class AssetImporter extends ItemImporter
{
$editingAsset = false;
$asset_tag = $this->findCsvMatch($row, 'asset_tag');
if(empty($asset_tag)){
$asset_tag = Asset::autoincrement_asset();
}
$asset = Asset::where(['asset_tag'=> $asset_tag])->first();
if ($asset) {
if (! $this->updating) {