mirror of
https://github.com/snipe/snipe-it.git
synced 2025-02-02 08:21:09 -08:00
Merge pull request #11161 from snipe/fixes/corrects_retagging_script
Small fixes for asset tag regeneration script
This commit is contained in:
commit
deda1c2fd6
|
@ -60,7 +60,7 @@ class RegenerateAssetTags extends Command
|
|||
}
|
||||
|
||||
foreach ($total_assets as $asset) {
|
||||
$start_tag++;
|
||||
|
||||
$output['info'][] = 'Asset tag:'.$asset->asset_tag;
|
||||
$asset->asset_tag = $settings->auto_increment_prefix.$settings->auto_increment_prefix.$start_tag;
|
||||
|
||||
|
@ -72,7 +72,14 @@ class RegenerateAssetTags extends Command
|
|||
|
||||
// Use forceSave here to override model level validation
|
||||
$asset->forceSave();
|
||||
$start_tag++;
|
||||
if ($bar) {
|
||||
$bar->advance();
|
||||
}
|
||||
}
|
||||
|
||||
$settings->next_auto_tag_base = Asset::zerofill($start_tag, $settings->zerofill_count);
|
||||
$settings->save();
|
||||
|
||||
$bar->finish();
|
||||
$this->info("\n");
|
||||
|
|
Loading…
Reference in a new issue