Bulk delete not checking the assigned_to type
Please confirm you have done the following before posting your bug report:
- [ ] I have enabled debug mode
- [ ] I have read checked the Common Issues page
Describe the bug I just got a glitch. Deleted the disabled user. Deleted via check and delete. The user did not have any assigned assets. In the magazine, I was horrified to see that a lot of assets were released to the warehouse. These assets were never assigned to the dismissed user. Assets were previously assigned to the location.
To Reproduce Steps to reproduce the behavior:
- Go to '...'
- Click on '....'
- Scroll down to '....'
- See error
Expected behavior A clear and concise description of what you expected to happen.
Screenshots

Server (please complete the following information):
- Snipe-IT Version v4.9.2
- OS: CentOS
- Web Server: Apache
- PHP Version 7.3.9
**Desktop (please complete the following information):
OS: [e.g. iOS] Windows 10 Browser chrome, firefox Version Last Ver
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.
Additional context
- Is this a fresh install or an upgrade? upgrade
- What OS and web server you're running Snipe-IT on
- What method you used to install Snipe-IT (install.sh, manual installation, docker, etc) install.sh
- Include what you've done so far in the installation, and if you got any error messages along the way.
- Indicate whether or not you've manually edited any data directly in the database
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.
I can reproduce this error in Version v4.9.2 - build 4352 (master).
If you "bulk delete" users, the assets checked out to the locations with the same location ID as the user's ID are bulk checked in. There seems to be a check missing wether the ID in the assigned_to field is a user ID or location / asset ID when bulk deleting users.
Please be aware about the severity of this bug since it did lead to several hundreds of assets erroneously checked in from locations in my installation upon deleting users.
Greetings,
^.^ Dingo
--
Is this still relevant? We haven't heard from anyone in a bit. If so, please comment with any updates or additional detail. This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Don't take it personally, we just need to keep a handle on things. Thank you for your contributions!
Still relevant.
Okay, it looks like this issue or feature request might still be important. We'll re-open it for now. Thank you for letting us know!
Is this still relevant? We haven't heard from anyone in a bit. If so, please comment with any updates or additional detail. This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Don't take it personally, we just need to keep a handle on things. Thank you for your contributions!
Closing as this is already fixed in https://github.com/snipe/snipe-it/commit/d64b35c348022933edc74796b7095ed49fcd7b12