https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43546 --- Comment #10 from Andrew Fuerste-Henry <andrew@bywatersolutions.com> --- (In reply to Alex Carver [Acerock7] from comment #9)
Adding this here, because I believe it's an issue with the original cart_to_shelf.pl logic and not the updated script:
Because 0 is no longer an option, the smallest option is now 1. However, because it's a whole integer, an item will only ever have a timestaff difference of >1 after it's been on the cart for 2 hours.
So using this updated script it's impossible to put an item back to its original location after it's been on the cart for an hour. For "TIMESTAMPDIFF(HOUR, items.timestamp, NOW() ) > 1" to be true, it'd need to have been on the cart for 2 hours or more.
Updating the logic to be:
"SELECT itemnumber FROM items WHERE location = 'CART' AND TIMESTAMPDIFF(HOUR, items.timestamp, NOW() ) >= ?"
fixes that issue in my testing. But I'm not experienced enough to know whether there's a deeper reasoning for the original logic or if adding >= messes with anything else behind the scenes.
I agree this is not working as described or expected. I've filed a separate bug, since this behavior predates these patches and if we're going to change it I'd like to see a very clear commit for it. -- You are receiving this mail because: You are watching all bug changes.