https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43546
--- Comment #4 from Martin Renvoize (ashimema) <[email protected]> --- Created attachment 206186 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=206186&action=edit Bug 43546: (follow-up) Reject negative --hours in cart_to_shelf.pl via a Params::Validate callback --hours is only checked for being present (required => 1), not for being a sensible value. A negative --hours would make the TIMESTAMPDIFF(HOUR, ...) > ? comparison true for essentially every item ever placed on the cart, reverting far more than intended, instead of failing with a clear error. Add a callback requiring --hours to be zero or a positive integer. Zero must stay valid: it's the documented immediate-revert case, already covered by this bug's own test plan (--hours 0 reverts cart items straight away), and is not itself the bug -- only negative values are. Test plan: 1. cart_to_shelf.pl --hours -5 Rejected: --hours must be zero or a positive integer. 2. cart_to_shelf.pl --hours 0 Still works exactly as before (immediate revert). 3. cart_to_shelf.pl --hours 24 Still works exactly as before. 4. koha-qa.pl passes. -- You are receiving this mail because: You are watching all bug changes. _______________________________________________ Koha-bugs mailing list -- [email protected] To unsubscribe send an email to [email protected] website : http://www.koha-community.org/ git : http://git.koha-community.org/ bugs : http://bugs.koha-community.org/
