Browse Source

Bug 31120: Items will renew for zero ( 0 ) days if renewalperiod is blank/empty value

If the rule renewalperiod is the blank empty string instead of being null/undefined or non-existant, Koha will interpret the renewal period as being zero days instead of falling back to the issuelength rule.

It makes sense to me that a literal 0 here should make it renew for zero days even though that is nonsensical.

Test Plan:
1) Delete all your rules
2) Create an all/all/all rules with an empty string for renewal base
   period
3) Note that renewing an item does nothing
4) Apply this patch
5) Restart all the things!
6) Renew again
7) Note the renewal uses the issuelength rule as intended

Signed-off-by: Sally <sally.healey@cheshiresharedservices.gov.uk>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
22.11.x
Kyle Hall 2 years ago
committed by Tomas Cohen Arazi
parent
commit
9b010d99df
Signed by: tomascohen GPG Key ID: 0A272EA1B2F3C15F
  1. 2
      C4/Circulation.pm

2
C4/Circulation.pm

@ -3759,7 +3759,7 @@ sub CalcDateDue {
my $loanlength =
GetLoanLength( $borrower->{'categorycode'}, $itemtype, $branch );
my $length_key = ( $isrenewal and defined $loanlength->{renewalperiod} )
my $length_key = ( $isrenewal and defined $loanlength->{renewalperiod} and $loanlength->{renewalperiod} ne q{} )
? qq{renewalperiod}
: qq{issuelength};

Loading…
Cancel
Save