In my database I have some large numbers in some database columns (categories.enrolmentfee for instance), because of TestBuilder I think. In that case, this cause admin/categories.pl to die with the following error message: Template process failed: undef error - round() overflow. Try smaller precision or use Math::BigFloat at /home/koha/src/Koha/Number/Price.pm line 44 This shouldn't happen in real life, but as Koha allows to enter such big numbers, this should probably be fixed. Steps to reproduce: 1. Go to Admin ยป Categories 2. Click on "New category" button 3. Fill in the required field and set enrolment fee to a big number like 123456789012345 (15 digits seem to be the minimum to reproduce the bug) 4. Save 5. Boom!
*** Bug 16832 has been marked as a duplicate of this bug. ***
*** Bug 18774 has been marked as a duplicate of this bug. ***
Created attachment 69982 [details] [review] Bug 15770: Do not format numbers if too big At several places we got the following error if we use numbers too big for Number::Format Template process failed: undef error - round() overflow. Try smaller precision or use Math::BigFloat at /home/koha/src/Koha/Number/Price.pm line 44 It make the app explodes. The goal here is to handle these errors gracefully and easily. Test plan: - Add a manual fine to a patron of 100000000000000 - Create a patron category with an enrolment fee of 123456789012345
*** Bug 19711 has been marked as a duplicate of this bug. ***
Created attachment 70753 [details] [review] Bug 15770: Do not format numbers if too big At several places we got the following error if we use numbers too big for Number::Format Template process failed: undef error - round() overflow. Try smaller precision or use Math::BigFloat at /home/koha/src/Koha/Number/Price.pm line 44 It make the app explodes. The goal here is to handle these errors gracefully and easily. Test plan: - Add a manual fine to a patron of 100000000000000 - Create a patron category with an enrolment fee of 123456789012345 Signed-off-by: Mark Tompsett <mtompset@hotmail.com>
Created attachment 70762 [details] [review] Bug 15770: Do not format numbers if too big At several places we got the following error if we use numbers too big for Number::Format Template process failed: undef error - round() overflow. Try smaller precision or use Math::BigFloat at /home/koha/src/Koha/Number/Price.pm line 44 It make the app explodes. The goal here is to handle these errors gracefully and easily. Test plan: - Add a manual fine to a patron of 100000000000000 - Create a patron category with an enrolment fee of 123456789012345 Signed-off-by: Mark Tompsett <mtompset@hotmail.com> Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Pushed to master for 18.05, thanks to everybody involved!
Awesome work all! Pushed to Stable for 17.11.02
Pushed to 17.05.x for v17.05.09
*** Bug 17164 has been marked as a duplicate of this bug. ***