Auto Increment doesn't increment after asset tag edited
Please confirm you have done the following before posting your bug report:
- [x] I have enabled debug mode
- [x] I have read checked the Common Issues page
Describe the bug Not sure what the proper way to handle this unique scenario, but we had a laptops plastics replaced under warranty, but the old asset tag wouldn't come off, so we edited the asset in Snipe-It with a new tag (we get our tags pre-printed in batches of 1000). We have auto increment on and when we went to create the next asset, it didn't auto increment.
We can't decide if Snipe-IT should auto increment based on the highest asset tag (ideal in our use case), or if we should risk losing all the historical data of that asset by retiring it and creating a new one. It's more cost prohibitive for us to get a single tag printed for one-off cases like this.
I know we can just edit the next auto-increment item, but I'm not sure if this would be a bug, or if anyone would have the best way to handle this odd scenario, since it's not a new item, and I can't use the same asset tag sticker itself.
To Reproduce Steps to reproduce the behavior:
- Edit created asset with new asset tag number (old 00999, new 01234)
- Try to clone/create new asset tag
- Error: The new asset is created with the same asset tag number 01234
Expected behavior The next asset tag should be 01235, auto-incrementing
Screenshots N/A
Server (please complete the following information):
- Snipe-IT Version v5.1.0 - build 5772 (master)
- OS: [e.g. Ubuntu, CentOS] Ubuntu 18.04
- Web Server: [e.g. Apache, IIS] Apache
- PHP Version 7.4.15
Desktop (please complete the following information):
- OS: Windows
- Browser Firefox
- Version 89
Smartphone (please complete the following information):
- Device: [e.g. iPhone6]
- OS: [e.g. iOS8.1]
- Browser [e.g. stock browser, safari]
- Version [e.g. 22]
Error Messages
- WITH DEBUG TURNED ON, if you're getting an error in your browser, include that error
- If a stacktrace is provided in the error, include that too.
- Any errors that appear in your browser's error console.
- Confirm whether the error is reproducible on the demo: https://snipeitapp.com/demo.
- Include any additional information you can find in
storage/logsand your webserver's logs. - Include the output from
php -m(this should display what modules you have enabled.) - No Error Messages
Additional context
- Is this a fresh install or an upgrade? Upgrade
- What OS and web server you're running Snipe-IT on Ubuntu Server - Apache
- What method you used to install Snipe-IT (install.sh, manual installation, docker, etc) Manual Installation
- Include what you've done so far in the installation, and if you got any error messages along the way. No error Messages
- Indicate whether or not you've manually edited any data directly in the database no
Add any other context about the problem here.
Please do not post an issue without answering the related questions above. If you have opened a different issue and already answered these questions, answer them again, once for every ticket. It will be next to impossible for us to help you.
👋 Thanks for opening your first issue here! If you're reporting a 🐞 bug, please make sure you include steps to reproduce it. We get a lot of issues on this repo, so please be patient and we will get back to you as soon as we can.
If you specified it correctly, you have a fairly old version of the program. Try upgrading to the latest version. Similar problems were encountered in some previous versions of the program, when it was possible to create duplicates of asset tags.
If you specified it correctly, you have a fairly old version of the program. Try upgrading to the latest version. Similar problems were encountered in some previous versions of the program, when it was possible to create duplicates of asset tags.
So looking at the demo, it's not weird at all, the version at the bottom of the screen is a similar style " Version v5.1.6 - build 6109 (master) "
Also I can confirm that the same thing happens on the demo, and this has nothing to do with duplicate asset tags, I can't save the new item because it is using the same asset tag that I changed the old asset to. The problem is that by modifying the old asset with the latest available asset tag, Snipe-it does not automatically add one to the auto-increment variable that is stored in the database. (Which I can modify by going to https://demo.snipeitapp.com/admin/asset_tags )
Again I don't know if this is more of a feature request, a bug, or if I'm just looking for direction on how best to handle this weird scenario. For the time being I just manually changed the "Next Auto Increment" setting to add 1 to the number, but still interested to see if this would be a bug or what others think.