Summary: | Warnings from GetIssuingCharge when rental discount is not set | ||
---|---|---|---|
Product: | Koha | Reporter: | Nick Clemens (kidclamp) <nick> |
Component: | Circulation | Assignee: | Nick Clemens (kidclamp) <nick> |
Status: | CLOSED FIXED | QA Contact: | Testopia <testopia> |
Severity: | normal | ||
Priority: | P5 - low | CC: | david, fridolin.somers, gmcharlt, kyle.m.hall, kyle, victor |
Version: | Main | ||
Hardware: | All | ||
OS: | All | ||
GIT URL: | Change sponsored?: | --- | |
Patch complexity: | Trivial patch | Documentation contact: | |
Documentation submission: | Text to go in the release notes: |
This fixes the cause of warning messages in the log files when the rental discount in the circulation rules has a blank value.
Before this fix, multiple warning messages "[2021/07/28 12:11:25] [WARN] Argument "" isn't numeric in subtraction (-) at /kohadevbox/koha/C4/Circulation.pm line 3385." appeared in the log files. These warnings occurred for items checked out where they had rental charges and the rental discount value in the circulation rules was blank.
|
|
Version(s) released in: |
21.11.00,21.05.04,20.11.10
|
Circulation function: | |
Attachments: |
Bug 28774: Don't store blank values for rental discount
Bug 28774: Don't store blank values for rental discount Bug 28774: Don't store blank values for rental discount |
Description
Nick Clemens (kidclamp)
2021-07-28 12:23:38 UTC
Created attachment 123248 [details] [review] Bug 28774: Don't store blank values for rental discount This patch adds 'can_be_blank => 0' for the rentaldiscount rule to prevent storing blank values in the database Additionally, if there is no charge we do not need to check for a discount and can simply return To test: 1 - Set rental discount to "" to a rule in circulation rules 2 - Checkout an item that will follow this rule 3 - Check the intranet log: [WARN] Argument "" isn't numeric in subtraction (-) at /kohadevbox/koha/C4/Circulation.pm line 3385. 4 - Apply patch and restart all 5 - Update database 6 - Set the rule to "" again 7 - Check the DB, no rule is stored SELECT * FROM circulation_rules WHERE rule_name = 'rentaldiscount'; 8 - Checkout the item again 9 - No warns in log Created attachment 123347 [details] [review] Bug 28774: Don't store blank values for rental discount This patch adds 'can_be_blank => 0' for the rentaldiscount rule to prevent storing blank values in the database Additionally, if there is no charge we do not need to check for a discount and can simply return To test: 1 - Set rental discount to "" to a rule in circulation rules 2 - Checkout an item that will follow this rule 3 - Check the intranet log: [WARN] Argument "" isn't numeric in subtraction (-) at /kohadevbox/koha/C4/Circulation.pm line 3385. 4 - Apply patch and restart all 5 - Update database 6 - Set the rule to "" again 7 - Check the DB, no rule is stored SELECT * FROM circulation_rules WHERE rule_name = 'rentaldiscount'; 8 - Checkout the item again 9 - No warns in log Signed-off-by: David Nind <david@davidnind.com> Created attachment 124253 [details] [review] Bug 28774: Don't store blank values for rental discount This patch adds 'can_be_blank => 0' for the rentaldiscount rule to prevent storing blank values in the database Additionally, if there is no charge we do not need to check for a discount and can simply return To test: 1 - Set rental discount to "" to a rule in circulation rules 2 - Checkout an item that will follow this rule 3 - Check the intranet log: [WARN] Argument "" isn't numeric in subtraction (-) at /kohadevbox/koha/C4/Circulation.pm line 3385. 4 - Apply patch and restart all 5 - Update database 6 - Set the rule to "" again 7 - Check the DB, no rule is stored SELECT * FROM circulation_rules WHERE rule_name = 'rentaldiscount'; 8 - Checkout the item again 9 - No warns in log Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Joonas Kylmälä <joonas.kylmala@iki.fi> Pushed to master for 21.11, thanks to everybody involved! Pushed to 21.05.x for 21.05.04 Pushed to 20.11.x for 20.11.10 Not backported to oldoldstable (20.05.x). Feel free to ask if it's needed. |