Bug 28144

Summary: Historical OVERDUE fines may not have an issue_id
Product: Koha Reporter: Nick Clemens <nick>
Component: Fines and feesAssignee: Nick Clemens <nick>
Status: CLOSED FIXED QA Contact: Testopia <testopia>
Severity: normal    
Priority: P5 - low CC: andrewfh, fridolin.somers, martin.renvoize, victor
Version: Main   
Hardware: All   
OS: All   
Change sponsored?: --- Patch complexity: Trivial patch
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
21.05.00,20.11.06,20.05.12
Attachments: Bug 28144: Check if issue_id defined
Bug 28144: Check if issue_id defined
Bug 28144: Add a regression test

Description Nick Clemens 2021-04-13 15:13:48 UTC

    
Comment 1 Nick Clemens 2021-04-13 15:18:36 UTC
Created attachment 119541 [details] [review]
Bug 28144: Check if issue_id defined

Historical OVERDUE fines may not have an issue_id - this causes
flooding of the logs when calling update fine

Trivial change, reading the code should be enough, but test plan below

To test:
1 - Create some fines without an issue_id
  - Either checkout an old version of Koha and add manually or
  - Checkout some items (backdated) to a patron, run fines.pl then
    UPDATE accountlines SET issue_id = NULL;
2 - Checkout a backdated item with fines in the circ rule to the same patron
3 - Run fines.pl
4 - Note the errors
5 - Apply patch
6 - Repeat and note no errors
Comment 2 Martin Renvoize 2021-04-26 14:32:48 UTC
Created attachment 120175 [details] [review]
Bug 28144: Check if issue_id defined

Historical OVERDUE fines may not have an issue_id - this causes
flooding of the logs when calling update fine

Trivial change, reading the code should be enough, but test plan below

To test:
1 - Create some fines without an issue_id
  - Either checkout an old version of Koha and add manually or
  - Checkout some items (backdated) to a patron, run fines.pl then
    UPDATE accountlines SET issue_id = NULL;
2 - Checkout a backdated item with fines in the circ rule to the same patron
3 - Run fines.pl
4 - Note the errors
5 - Apply patch
6 - Repeat and note no errors

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Comment 3 Martin Renvoize 2021-04-26 14:33:22 UTC
Works as expected, going straight for PQA.
Comment 4 Jonathan Druart 2021-04-27 13:04:58 UTC
Created attachment 120220 [details] [review]
Bug 28144: Add a regression test
Comment 5 Jonathan Druart 2021-04-27 14:26:01 UTC
Pushed to master for 21.05, thanks to everybody involved!
Comment 6 Fridolin Somers 2021-04-30 08:47:06 UTC
Pushed to 20.11.x for 20.11.06
Comment 7 Andrew Fuerste-Henry 2021-05-24 18:39:01 UTC
Pushed to 20.05.x for 20.05.12
Comment 8 Victor Grousset/tuxayo 2021-05-24 18:51:52 UTC
Not backported to oldoldstable (19.11.x). Feel free to ask if it's needed.