|
Description
Fridolin Somers
2022-01-19 20:59:07 UTC
> Default value should be considered has 0 or infinite ?
OK I see it means 0.
Created attachment 187860 [details] [review] Bug 29908: Remove warning when empty ClaimReturnedWarningThreshold in patron_messages.inc System preference ClaimReturnedWarningThreshold manages the display of a patron message in case of too many claims. But this preference may be empty. It is created empty in installer/data/mysql/mandatory/sysprefs.sql. This generates a warning : Argument "" isn't numeric in numeric gt (>) at /kohadevbox/koha/koha-tmpl/intranet-tmpl/prog/en/includes/patron_messages.inc line 128. Test plan : 1) Set systempreference 'ClaimReturnedWarningThreshold' empty 2) Go to a patron details page 3) Check there is no warning in logs 4) Go to a patron check-out page 5) Check there is no warning in logs 6) Set systempreference 'ClaimReturnedWarningThreshold' with an integer (ie 5) Repeat from 2) Created attachment 187884 [details] [review] Bug 29908: Remove warning when empty ClaimReturnedWarningThreshold in patron_messages.inc System preference ClaimReturnedWarningThreshold manages the display of a patron message in case of too many claims. But this preference may be empty. It is created empty in installer/data/mysql/mandatory/sysprefs.sql. This generates a warning : Argument "" isn't numeric in numeric gt (>) at /kohadevbox/koha/koha-tmpl/intranet-tmpl/prog/en/includes/patron_messages.inc line 128. Test plan : 1) Set systempreference 'ClaimReturnedWarningThreshold' empty 2) Go to a patron details page 3) Check there is no warning in logs 4) Go to a patron check-out page 5) Check there is no warning in logs 6) Set systempreference 'ClaimReturnedWarningThreshold' with an integer (ie 5) Repeat from 2) Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> ('ClaimReturnedWarningThreshold', '', '', 'Sets the number of return claims past which the librarian will be warned the patron has many return claims', 'Integer'),
Why not correct it and add a dbrev?
(In reply to Marcel de Rooy from comment #4) > ('ClaimReturnedWarningThreshold', '', '', 'Sets the number of return claims > past which the librarian will be warned the patron has many return claims', > 'Integer'), > > Why not correct it and add a dbrev? I see there are several other system preferences type integer that starts with empty string. ('DefaultLongOverdueChargeValue', '', NULL, "Charge a lost item to the borrower's account when the LOST value of the item changes to n.", 'integer'), ('DefaultLongOverdueDays', '', NULL, "Set the LOST value of an item when the item has been overdue for more than n days.", 'integer'), ('DefaultLongOverdueLostValue', '', NULL, "Set the LOST value of an item to n when the item has been overdue for more than defaultlongoverduedays days.", 'integer'), It allows to make a difference between unset preference and set with value 0. In my opinion better create a strong code. (In reply to Fridolin Somers from comment #5) > (In reply to Marcel de Rooy from comment #4) > I see there are several other system preferences type integer that starts > with empty string. > ('DefaultLongOverdueChargeValue', '', NULL, "Charge a lost item to the > borrower's account when the LOST value of the item changes to n.", > 'integer'), > ('DefaultLongOverdueDays', '', NULL, "Set the LOST value of an item when the > item has been overdue for more than n days.", 'integer'), > ('DefaultLongOverdueLostValue', '', NULL, "Set the LOST value of an item to > n when the item has been overdue for more than defaultlongoverduedays > days.", 'integer'), > > It allows to make a difference between unset preference and set with value 0. The examples above make a difference with empty string or NULL. But this pref does not. But I will pass QA on it altogether. This does not need that much attention. Created attachment 189011 [details] [review] Bug 29908: Remove warning when empty ClaimReturnedWarningThreshold in patron_messages.inc System preference ClaimReturnedWarningThreshold manages the display of a patron message in case of too many claims. But this preference may be empty. It is created empty in installer/data/mysql/mandatory/sysprefs.sql. This generates a warning : Argument "" isn't numeric in numeric gt (>) at /kohadevbox/koha/koha-tmpl/intranet-tmpl/prog/en/includes/patron_messages.inc line 128. Test plan : 1) Set systempreference 'ClaimReturnedWarningThreshold' empty 2) Go to a patron details page 3) Check there is no warning in logs 4) Go to a patron check-out page 5) Check there is no warning in logs 6) Set systempreference 'ClaimReturnedWarningThreshold' with an integer (ie 5) Repeat from 2) Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Nice work everyone! Pushed to main for 25.11 Nice work everyone! Pushed to 25.05.x |