[Bug 17164] New: Software error when enrolment fee or reserve fee are too high ( Patron categories)
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17164 Bug ID: 17164 Summary: Software error when enrolment fee or reserve fee are too high (Patron categories) Change sponsored?: --- Product: Koha Version: master Hardware: All OS: All Status: NEW Severity: enhancement Priority: P5 - low Component: System Administration Assignee: koha-bugs@lists.koha-community.org Reporter: aleishaamohia@hotmail.com QA Contact: testopia@bugs.koha-community.org CC: gmcharlt@gmail.com For some reason I had ridiculously high enrolment fee and reserve fee data causing a software error when trying to access Patron Categories Software error: Template process failed: undef error - round() overflow. Try smaller precision or use Math::BigFloat at /home/vagrant/kohaclone/Koha/Number/Price.pm line 44. My enrolment fee was set at 8866609962973970000000.00 and my reserve fee was set at 3862694923528880000000.00 Obviously it's very unlikely for a librarian to set the enrolment fee or reserve fee to be this high but if it happens accidentally, it breaks the system and causes this error. Perhaps there should be some kind of constraint when entering this, like a maximum reserve fee constraint etc.? -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17164 Lari Taskula <lari.taskula@jns.fi> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |lari.taskula@jns.fi --- Comment #1 from Lari Taskula <lari.taskula@jns.fi> --- I noticed the same issue in my test database. For me the high fees are probably caused by test builder setting some random huge number. It works after lowering the fees. -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17164 Lari Taskula <lari.taskula@jns.fi> changed: What |Removed |Added ---------------------------------------------------------------------------- Patch complexity|--- |Trivial patch Status|NEW |Needs Signoff -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17164 --- Comment #2 from Lari Taskula <lari.taskula@jns.fi> --- Created attachment 56915 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=56915&action=edit Bug 17164: Lower maximum digits of enrolmentfee and reservefee in categories If the values are too high, Patron Categories page will crash with: Software error: Template process failed: undef error - round() overflow. Try smaller precision or use Math::BigFloat at /home/vagrant/kohaclone/Koha/Number/Price.pm line 44. This is likely caused by test builder setting random huge numbers when creating categories. I found out that 19 digits is the maximum that can be handled. Surely it is enough for both enrolmentfee and reservefee. This patch lowers the maximum number of significant digits in order to avoid this crash. To test: 1. Set category enrolmentfee with a high value, like 3862694923528880000000.0000 2. Go to cgi-bin/koha/admin/categories.pl 3. Observe Software error 4. Apply patch and run updatedatabase.pl 5. Reload the page 6. Observe that software error is gone -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17164 Mika <mikasmith@catalyst.net.nz> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Signed Off -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17164 Mika <mikasmith@catalyst.net.nz> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #56915|0 |1 is obsolete| | --- Comment #3 from Mika <mikasmith@catalyst.net.nz> --- Created attachment 57815 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=57815&action=edit Bug 17164: Lower maximum digits of enrolmentfee and reservefee in categories If the values are too high, Patron Categories page will crash with: Software error: Template process failed: undef error - round() overflow. Try smaller precision or use Math::BigFloat at /home/vagrant/kohaclone/Koha/Number/Price.pm line 44. This is likely caused by test builder setting random huge numbers when creating categories. I found out that 19 digits is the maximum that can be handled. Surely it is enough for both enrolmentfee and reservefee. This patch lowers the maximum number of significant digits in order to avoid this crash. To test: 1. Set category enrolmentfee with a high value, like 3862694923528880000000.0000 2. Go to cgi-bin/koha/admin/categories.pl 3. Observe Software error 4. Apply patch and run updatedatabase.pl 5. Reload the page 6. Observe that software error is gone Signed-off-by: Mika Smith <mikasmith@catalyst.net.nz> -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17164 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |jonathan.druart@bugs.koha-c | |ommunity.org --- Comment #4 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- We use 28,6 for almost all the price fields, I think we should stick with it. Have a look at bug 15770 and bug 11698. Note that the tests should be executed in a transaction and these random data should not persist in DB. If it happens, we need to fix the tests, which are the root of the problem. -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17164 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- See Also| |https://bugs.koha-community | |.org/bugzilla3/show_bug.cgi | |?id=15770, | |https://bugs.koha-community | |.org/bugzilla3/show_bug.cgi | |?id=11698 -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17164 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Signed Off |Failed QA -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17164 Marc Véron <veron@veron.ch> changed: What |Removed |Added ---------------------------------------------------------------------------- See Also| |https://bugs.koha-community | |.org/bugzilla3/show_bug.cgi | |?id=18774 -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17164 Owen Leonard <oleonard@myacpl.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Assignee|koha-bugs@lists.koha-commun |lari.taskula@jns.fi |ity.org | -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17164 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Failed QA |RESOLVED Resolution|--- |DUPLICATE --- Comment #5 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- Fixed by bug 15770. *** This bug has been marked as a duplicate of bug 15770 *** -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org