Bug 24259

Summary: Circulation fails if no circ rule defined but checkout override confirmed
Product: Koha Reporter: Nick Clemens (kidclamp) <nick>
Component: CirculationAssignee: Jonathan Druart <jonathan.druart>
Status: CLOSED FIXED QA Contact: Testopia <testopia>
Severity: major    
Priority: P5 - low CC: 1joynelson, gmcharlt, hc, jonathan.druart, kyle.m.hall, lucas, martin.renvoize
Version: Main   
Hardware: All   
OS: All   
Change sponsored?: --- Patch complexity: ---
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
20.05.00, 19.11.02
Bug Depends on: 20912    
Bug Blocks:    
Attachments: Bug 24259: Handle non existing default circ rule in Charges::Fees
Bug 24259: Handle non existing default circ rule in Charges::Fees
Bug 24259: Handle non existing default circ rule in Charges::Fees
Bug 24259: Handle non existing default circ rule in Charges::Fees

Description Nick Clemens (kidclamp) 2019-12-18 04:24:22 UTC
Can't call method "lengthunit" on an undefined value at /usr/share/koha/lib/Koha/Charges/Fees.pm line 101.

TO recreate:
1 - Remove all/all rule form circulation rules
2 - Define a rental fee per day for an itemtype
3 - Checkout an item of this type ot patron
4 - Should get note of no circ rule defined
5 - Confirm the checkout, internal server error
Comment 1 Nick Clemens (kidclamp) 2019-12-18 04:32:58 UTC
Note, you don't have to have a rental charge defined - the checkout triggers the error as we always check the rental charge to see if there is one or not
Comment 2 Jonathan Druart 2019-12-18 09:51:59 UTC
Created attachment 96407 [details] [review]
Bug 24259: Handle non existing default circ rule in Charges::Fees

Can't call method "lengthunit" on an undefined value at
/usr/share/koha/lib/Koha/Charges/Fees.pm line 101.

Test plan:
1 - Remove all/all rule form circulation rules
2 - Define a rental fee per day for an itemtype
3 - Checkout an item of this type ot patron
4 - Should get note of no circ rule defined
5 - Confirm the checkout
=> item is checked out
Comment 3 Jonathan Druart 2019-12-18 09:53:03 UTC
Created attachment 96408 [details] [review]
Bug 24259: Handle non existing default circ rule in Charges::Fees

Can't call method "lengthunit" on an undefined value at
/usr/share/koha/lib/Koha/Charges/Fees.pm line 101.

Test plan:
1 - Remove all/all rule form circulation rules
2 - Define a rental fee per day for an itemtype
3 - Checkout an item of this type ot patron
4 - Should get note of no circ rule defined
5 - Confirm the checkout
=> item is checked out
Comment 4 ByWater Sandboxes 2019-12-19 15:29:18 UTC
Created attachment 96488 [details] [review]
Bug 24259: Handle non existing default circ rule in Charges::Fees

Can't call method "lengthunit" on an undefined value at
/usr/share/koha/lib/Koha/Charges/Fees.pm line 101.

Test plan:
1 - Remove all/all rule form circulation rules
2 - Define a rental fee per day for an itemtype
3 - Checkout an item of this type ot patron
4 - Should get note of no circ rule defined
5 - Confirm the checkout
=> item is checked out

Signed-off-by: hc <hc@interleaf.ie>
Comment 5 Nick Clemens (kidclamp) 2019-12-20 13:50:26 UTC
Created attachment 96525 [details] [review]
Bug 24259: Handle non existing default circ rule in Charges::Fees

Can't call method "lengthunit" on an undefined value at
/usr/share/koha/lib/Koha/Charges/Fees.pm line 101.

Test plan:
1 - Remove all/all rule form circulation rules
2 - Define a rental fee per day for an itemtype
3 - Checkout an item of this type ot patron
4 - Should get note of no circ rule defined
5 - Confirm the checkout
=> item is checked out

Signed-off-by: hc <hc@interleaf.ie>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Comment 6 Martin Renvoize 2019-12-23 10:52:19 UTC
Nice work everyone!

Pushed to master for 20.05
Comment 7 Joy Nelson 2020-01-03 22:24:48 UTC
Pushed to 19.11.x for 19.11.02
Comment 8 Lucas Gass 2020-01-09 21:43:06 UTC
backported to 19.05.x for 19.05.07