Bugzilla – Attachment 56915 Details for
Bug 17164
Software error when enrolment fee or reserve fee are too high (Patron categories)
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 17164: Lower maximum digits of enrolmentfee and reservefee in categories
Bug-17164-Lower-maximum-digits-of-enrolmentfee-and.patch (text/plain), 3.37 KB, created by
Lari Taskula
on 2016-10-27 12:21:45 UTC
(
hide
)
Description:
Bug 17164: Lower maximum digits of enrolmentfee and reservefee in categories
Filename:
MIME Type:
Creator:
Lari Taskula
Created:
2016-10-27 12:21:45 UTC
Size:
3.37 KB
patch
obsolete
>From 7dd83fc1f2b27943d6e2b3cc90308c285cdae819 Mon Sep 17 00:00:00 2001 >From: Lari Taskula <lari.taskula@jns.fi> >Date: Thu, 27 Oct 2016 15:15:21 +0300 >Subject: [PATCH] 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 >--- > .../Bug_17164-Lower_enrolmentfee_and_reservefee_max_digits.sql | 3 +++ > installer/data/mysql/kohastructure.sql | 4 ++-- > 2 files changed, 5 insertions(+), 2 deletions(-) > create mode 100644 installer/data/mysql/atomicupdate/Bug_17164-Lower_enrolmentfee_and_reservefee_max_digits.sql > >diff --git a/installer/data/mysql/atomicupdate/Bug_17164-Lower_enrolmentfee_and_reservefee_max_digits.sql b/installer/data/mysql/atomicupdate/Bug_17164-Lower_enrolmentfee_and_reservefee_max_digits.sql >new file mode 100644 >index 0000000..33846a4 >--- /dev/null >+++ b/installer/data/mysql/atomicupdate/Bug_17164-Lower_enrolmentfee_and_reservefee_max_digits.sql >@@ -0,0 +1,3 @@ >+ALTER TABLE `categories` >+CHANGE COLUMN `enrolmentfee` `enrolmentfee` DECIMAL(19,6) NULL DEFAULT NULL , >+CHANGE COLUMN `reservefee` `reservefee` DECIMAL(19,6) NULL DEFAULT NULL ; >diff --git a/installer/data/mysql/kohastructure.sql b/installer/data/mysql/kohastructure.sql >index 6b6fe57..71b6081 100644 >--- a/installer/data/mysql/kohastructure.sql >+++ b/installer/data/mysql/kohastructure.sql >@@ -322,10 +322,10 @@ CREATE TABLE `categories` ( -- this table shows information related to Koha patr > `dateofbirthrequired` tinyint(1) default NULL, -- the minimum age required for the patron category > `finetype` varchar(30) default NULL, -- unused in Koha > `bulk` tinyint(1) default NULL, >- `enrolmentfee` decimal(28,6) default NULL, -- enrollment fee for the patron >+ `enrolmentfee` decimal(19,6) default NULL, -- enrollment fee for the patron > `overduenoticerequired` tinyint(1) default NULL, -- are overdue notices sent to this patron category (1 for yes, 0 for no) > `issuelimit` smallint(6) default NULL, -- unused in Koha >- `reservefee` decimal(28,6) default NULL, -- cost to place holds >+ `reservefee` decimal(19,6) default NULL, -- cost to place holds > `hidelostitems` tinyint(1) NOT NULL default '0', -- are lost items shown to this category (1 for yes, 0 for no) > `category_type` varchar(1) NOT NULL default 'A', -- type of Koha patron (Adult, Child, Professional, Organizational, Statistical, Staff) > `BlockExpiredPatronOpacActions` tinyint(1) NOT NULL default '-1', -- wheither or not a patron of this category can renew books or place holds once their card has expired. 0 means they can, 1 means they cannot, -1 means use syspref BlockExpiredPatronOpacActions >-- >1.9.1
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 17164
:
56915
|
57815