Bugzilla – Attachment 128553 Details for
Bug 29476
Earliest renewal date is displayed wrong in circ/renew.pl for issues with auto renewing
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 29476: (follow-up) Fix return, add precision test
Bug-29476-follow-up-Fix-return-add-precision-test.patch (text/plain), 2.22 KB, created by
Jonathan Druart
on 2021-12-15 10:32:09 UTC
(
hide
)
Description:
Bug 29476: (follow-up) Fix return, add precision test
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2021-12-15 10:32:09 UTC
Size:
2.22 KB
patch
obsolete
>From bdeefe300e70bd3c5a26f46fbdb698bd5d8913c5 Mon Sep 17 00:00:00 2001 >From: Nick Clemens <nick@bywatersolutions.com> >Date: Mon, 13 Dec 2021 17:27:42 +0000 >Subject: [PATCH] Bug 29476: (follow-up) Fix return, add precision test > >Signed-off-by: Nick Clemens <nick@bywatersolutions.com> > >Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >--- > C4/Circulation.pm | 2 +- > t/db_dependent/Circulation.t | 9 ++++++++- > 2 files changed, 9 insertions(+), 2 deletions(-) > >diff --git a/C4/Circulation.pm b/C4/Circulation.pm >index 28742e2f4ed..3850b276eb6 100644 >--- a/C4/Circulation.pm >+++ b/C4/Circulation.pm >@@ -3199,7 +3199,7 @@ sub GetSoonestRenewDate { > return $soonestrenewal if $now < $soonestrenewal; > } elsif ( $itemissue->auto_renew && $patron->autorenew_checkouts ) { > # Checkouts with auto-renewing fall back to due date >- my $soonestrenewal = return dt_from_string( $itemissue->date_due ); >+ my $soonestrenewal = dt_from_string( $itemissue->date_due ); > if ( C4::Context->preference('NoRenewalBeforePrecision') eq 'date' > and $issuing_rule->{lengthunit} eq 'days' ) > { >diff --git a/t/db_dependent/Circulation.t b/t/db_dependent/Circulation.t >index 2981430bdc4..3b0b09b83f5 100755 >--- a/t/db_dependent/Circulation.t >+++ b/t/db_dependent/Circulation.t >@@ -4957,7 +4957,7 @@ subtest "SendCirculationAlert" => sub { > }; > > subtest "GetSoonestRenewDate tests" => sub { >- plan tests => 4; >+ plan tests => 5; > Koha::CirculationRules->set_rule( > { > categorycode => undef, >@@ -5007,7 +5007,14 @@ subtest "GetSoonestRenewDate tests" => sub { > 'Checkouts without auto-renewal can be renewed immediately if no norenewalbefore' > ); > >+ t::lib::Mocks::mock_preference( 'NoRenewalBeforePrecision', 'date' ); > $issue->auto_renew(1)->store; >+ is( >+ GetSoonestRenewDate( $patron->id, $item->itemnumber ), >+ $datedue->clone->truncate( to => 'day' ), >+ 'Checkouts with auto-renewal can be renewed earliest on due date if no renewalbefore' >+ ); >+ t::lib::Mocks::mock_preference( 'NoRenewalBeforePrecision', 'exact' ); > is( > GetSoonestRenewDate( $patron->id, $item->itemnumber ), > $datedue, >-- >2.25.1
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 29476
:
127618
|
127619
|
127620
|
127900
|
128096
|
128477
|
128478
|
128552
| 128553