Staff can create smart rules with empty (undefined) grace period, but then koha returns an internal error in : DateTime::Duration::new('DateTime::Duration', 'days', undef) called at /kohadevbox/koha/C4/Circulation.pm line 2395 C4::Circulation::_calculate_new_debar_dt(HASH(0x564b11658e58)', 'HASH(0x564b11836c28)', 'DateTime=HASH(0x564b1164d688)', 'DateTime=HASH(0x564b116787d0)') called at /kohadevbox/koha/C4/Circulation.pm line 2451
Created attachment 108432 [details] [review] Bug 26232: Empty smart rule fine grace period Staff can create smart rules with empty (undefined) fine grace period. In Overdues.pm undefined firstremind means 0, do the same in Circulation.pm. To test prove t/db_dependent/Circulation.t
Created attachment 108433 [details] [review] Bug 26232: Test for empty smart rule fine grace period
Created attachment 108434 [details] [review] Bug 26232: Empty smart rule fine grace period Staff can create smart rules with empty (undefined) fine grace period. In Overdues.pm undefined firstremind means 0, do the same in Circulation.pm. To test prove t/db_dependent/Circulation.t
Hi didier, can you please add a test plan here?
Created attachment 111034 [details] [review] Bug 26232: Empty smart rule fine grace period Staff can create smart rules with empty (undefined) fine grace period. In Overdues.pm undefined firstremind means 0, do the same in Circulation.pm. To test: 1. Apply these patches 2. Run: kshell prove t/db_dependent/Circulation.t
Created attachment 112403 [details] [review] Bug 26232: Test for empty smart rule fine grace period Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
Created attachment 112404 [details] [review] Bug 26232: Empty smart rule fine grace period Staff can create smart rules with empty (undefined) fine grace period. In Overdues.pm undefined firstremind means 0, do the same in Circulation.pm. To test: 1. Apply these patches 2. Run: kshell prove t/db_dependent/Circulation.t Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
Created attachment 112427 [details] [review] Bug 26232: Test for empty smart rule fine grace period Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz> Signed-off-by: Nick Clemens <nick@bywatersolutions.com> Current status: Passed QA
Created attachment 112428 [details] [review] Bug 26232: Empty smart rule fine grace period Staff can create smart rules with empty (undefined) fine grace period. In Overdues.pm undefined firstremind means 0, do the same in Circulation.pm. To test: 1. Apply these patches 2. Run: kshell prove t/db_dependent/Circulation.t Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz> Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
I cannot recreate the error adding rules via the stff client, but I believe the change makes sense
Pushed to master for 20.11, thanks to everybody involved!
backported to 20.05.x for 20.05.06
a bunch of failed tests on 19.11.x: $ prove t/db_dependent/Circulation.t t/db_dependent/Circulation.t .. 38/47 # Failed test 'Item can be issued to this patron' # at t/db_dependent/Circulation.t line 3005. # Structures begin differing at: # $got->{PATRON_CANT} = '1' # $expected->{PATRON_CANT} = Does not exist # Looks like you failed 1 test of 2. # Failed test 'CanBookBeIssued | item-level_itypes=biblio' # at t/db_dependent/Circulation.t line 3007. # Failed test 'Item can be issued to this patron' # at t/db_dependent/Circulation.t line 3040. # Structures begin differing at: # $got->{TOO_MANY} = 'NO_RULE_DEFINED' # $expected->{TOO_MANY} = Does not exist # Failed test 'No confirmation needed, AllowNotForLoanOverride=0' # at t/db_dependent/Circulation.t line 3046. # Structures begin differing at: # $got->{current_loan_count} = undef # $expected->{current_loan_count} = Does not exist # Failed test 'No confirmation needed, AllowNotForLoanOverride=0' # at t/db_dependent/Circulation.t line 3057. # Structures begin differing at: # $got->{current_loan_count} = undef # $expected->{current_loan_count} = Does not exist # Looks like you failed 3 tests of 6. # Failed test 'item-level_itypes = 1' # at t/db_dependent/Circulation.t line 3063. # Failed test 'Item can be issued to this patron' # at t/db_dependent/Circulation.t line 3082. # Structures begin differing at: # $got->{TOO_MANY} = 'NO_RULE_DEFINED' # $expected->{TOO_MANY} = Does not exist # Failed test 'No confirmation needed, AllowNotForLoanOverride=0' # at t/db_dependent/Circulation.t line 3088. # Structures begin differing at: # $got->{PATRON_CANT} = '1' # $expected->{PATRON_CANT} = Does not exist # Failed test 'No confirmation needed, AllowNotForLoanOverride=0' # at t/db_dependent/Circulation.t line 3099. # Structures begin differing at: # $got->{PATRON_CANT} = '1' # $expected->{PATRON_CANT} = Does not exist # Looks like you failed 3 tests of 6. # Failed test 'item-level_itypes = 0' # at t/db_dependent/Circulation.t line 3105. # Looks like you failed 2 tests of 2. # Failed test 'CanBookBeIssued | notforloan' # at t/db_dependent/Circulation.t line 3108. t/db_dependent/Circulation.t .. 44/47 # Failed test 'Item needs rentalcharge confirmation to be issued' # at t/db_dependent/Circulation.t line 3488. # Structures begin differing at: # $got->{current_loan_count} = undef # $expected->{current_loan_count} = Does not exist # Failed test 'Item needs rentalcharge confirmation to be issued, increment' # at t/db_dependent/Circulation.t line 3492. # Structures begin differing at: # $got->{TOO_MANY} = 'NO_RULE_DEFINED' # $expected->{TOO_MANY} = Does not exist # Looks like you failed 2 tests of 2. # Failed test 'CanBookBeIssued & RentalFeesCheckoutConfirmation' # at t/db_dependent/Circulation.t line 3494. # Looks like you failed 3 tests of 47. t/db_dependent/Circulation.t .. Dubious, test returned 3 (wstat 768, 0x300) Failed 3/47 subtests Test Summary Report ------------------- t/db_dependent/Circulation.t (Wstat: 768 Tests: 47 Failed: 3) Failed tests: 39-40, 45 Non-zero exit status: 3 Files=1, Tests=47, 20 wallclock secs ( 0.06 usr 0.01 sys + 15.52 cusr 1.96 csys = 17.55 CPU) Result: FAIL please fix if needed