License assignments not respecting seat position
Expected Behavior (or desired behavior if a feature request)
Open the license view / click on a license. Check out a specific license seat number to an asset/user. This assignment should stick to the chosen seat number.
Actual Behavior
Seat 1 will be overwritten, regardless of the seat number which was predefined.
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
Provide answers to these questions:
- Is this a fresh install or an upgrade?
- Version of Snipe-IT you're running: Version v4.1.3 build 48 (g74aa562)
- Version of PHP you're running
- Version of MySQL/MariaDB you're running
- 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)
- WITH DEBUG TURNED ON, if you're getting an error in your browser, include that error
- What specific Snipe-IT page you're on, and what specific element you're interacting with to trigger the 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 reproduceable on the demo: https://snipeitapp.com/demo.
- Include any additional information you can find in
app/storage/logsand your webserver's logs. - 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
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.
https://snipe-it.readme.io/docs/getting-help
But only if the license was added before 4.1.3, new ones are working fine. Here a little demo of the problem: https://files.gitter.im/snipe/snipe-it/d1Rf/snipe.mov
-- This issue is also in v4.1.3 build 94 (gb6a14d2)
Hi,
I am also facing this problem. I have been added Seat as 4 but when i try to checkout license for other employee it overrides the 1st seat. We are hosted on Snipe-It itself.
Yes, this is a problem for us as we can't checkout licenses right now. I'm going to try to upgrade to 4.14 and then if not, I'll downgrade.
We can't check out any licenses as it just takes over Seat 1, regardless of whether we do a manual seat selection or try to check out from the main license page.
Not working for us in v4.1.4 build 173 (gba38b84)
is this issue resolved?
On Thu, Nov 16, 2017 at 1:24 PM, diekmanu [email protected] wrote:
Not working for us in v4.1.4 build 173 (gba38b84)
— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/snipe/snipe-it/issues/4413#issuecomment-344843142, or mute the thread https://github.com/notifications/unsubscribe-auth/AZYt5xqLnwzZ1oYzJyYphRPp5jEl1codks5s2-oqgaJpZM4QYFtC .
-- “BTW: Take 2 Minutes to learn about Rahi Systems https://vimeo.com/184623096”. Ajay Kakde* |* Sr. Software Engineer O: +91-750 777 2500 | M: +91-997 502 8678 E: [email protected] Skype: rahi.ajay www.rahisystems.com http://www.rahisystems.com <#UNIQUE_ID_SafeHtmlFilter_UNIQUE_ID_SafeHtmlFilter_UNIQUE_ID_SafeHtmlFilter_UNIQUE_ID_SafeHtmlFilter_UNIQUE_ID_SafeHtmlFilter_> https://www.facebook.com/RahiSystems/ https://twitter.com/Rahi_Systems https://www.linkedin.com/company/rahi-systems http://rahisystems.com/blog/
Sorry but no, just give them a little more time to figure out how to fix it. Just monitor this thread and watch out for a commit ;)
@uknzaeinozpas - thanks so much. You’re right, we’re working on this - and when it’s fixed, this thread will be updated. It’s weirdly hard to reproduce, but we’re close to a fix
Had the same issue, Glad to see yo're already aware of it. One thing I love is when the creators are highly active in fixing bugs and releasing new versions.
Version v4.1.4 build 173 (gba38b84) clean install, same issue, only seat 1 checks out. Thankgs again Snipe admins :)
@snipe Hey, if you need anything to help narrow it down, the issue occurs for me each and every time in my environment (unfortunately).
Hi all,
Can any (or all) of you try try changing this section in app/Models/License.php from:
https://github.com/snipe/snipe-it/blob/98700cab8bf760d150eb4ef96c9ad706413b589c/app/Models/License.php#L348-L355
to:
public function freeSeat()
{
return $this->licenseseats()
->whereNull('deleted_at')
->where(function ($query) {
$query->whereNull('assigned_to')
->whereNull('asset_id');
})
->first();
}
And see if that fixes it for you?
@snipe Sure, I'll try that now. Do I need to do anything afterwards? cache:clear etc.?
@TheVakman you shouldn't have to, no.
All right, that's a negative on that change working.
Can you add a new test license and see if it works with that one? (Checkout multiple seats). Also can you tell me if it matters if you checkout to a user or you checkout to an asset?
It seems to be OK with a new license. I assigned five out of thirty seats on a test license, with this modification.
I've only ever assigned to users. I'll try to an asset.
I can checkout to an asset on the new test license, without any issues.
However, the same issue occurs when checking out existing licenses to an asset.
Thanks very much for helping us narrow it down. Hoping have a patch for you tonight.
@snipe No, thank you! I'll test it out tonight, if I see it within the next few hours while I'm up!
Can you pull from develop easily? If so, give that a shot.
Will do, just fixing something (non-SnipeIT related) and then I'll try it out!