In the routine Koha::StockRotationStage->move_to we are doing a stringwise comparison of the position to move to, versus the count of stages This works when we have a limited number of stages, but fails when we have many: perl -e 'warn "Yes" if "3" le "26"' It's not. Changing to <= seems to fix this
Created attachment 181395 [details] [review] Bug 39717: Use numeric comparison for stock rotation stages To test: 1 - Enable SotckRotation http://localhost:8081/cgi-bin/koha/admin/preferences.pl?op=search&searchfield=StockRotation 2 - Browse to "Cataloging -> StockRotation" 3 - 'New rota' - fill out the form and save 4 - Manage->stages 5 - Add many stages, more than 10 at least 6 - Try to move a stage form the bottom to position 3 7 - Note message above list: Saving changes... Error: Bad Request 8 - Apply patch, restart_all 9 - Attempt to move stages, try many combinations 10 - Success!
Created attachment 181396 [details] [review] Bug 39717: Use numeric comparison for stock rotation stages To test: 1 - Enable SotckRotation http://localhost:8081/cgi-bin/koha/admin/preferences.pl?op=search&searchfield=StockRotation 2 - Browse to "Cataloging -> StockRotation" 3 - 'New rota' - fill out the form and save 4 - Manage->stages 5 - Add many stages, more than 10 at least 6 - Try to move a stage form the bottom to position 3 7 - Note message above list: Saving changes... Error: Bad Request 8 - Apply patch, restart_all 9 - Attempt to move stages, try many combinations 10 - Success! Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Self SO, moving to QA, this is pretty straightforward
Created attachment 181401 [details] [review] Bug 39717: Use numeric comparison for stock rotation stages To test: 1 - Enable SotckRotation http://localhost:8081/cgi-bin/koha/admin/preferences.pl?op=search&searchfield=StockRotation 2 - Browse to "Cataloging -> StockRotation" 3 - 'New rota' - fill out the form and save 4 - Manage->stages 5 - Add many stages, more than 10 at least 6 - Try to move a stage form the bottom to position 3 7 - Note message above list: Saving changes... Error: Bad Request 8 - Apply patch, restart_all 9 - Attempt to move stages, try many combinations 10 - Success! Signed-off-by: Nick Clemens <nick@bywatersolutions.com> Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
Oops.. Passing QA
Pushed for 25.05! Well done everyone, thank you!