Bugzilla – Attachment 63057 Details for
Bug 12063
Change date calculation for reserve expiration to skip all holidays
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 12063 - Remove checking of ExpireReservesMaxPickUpDelay in CancelExpiredReserves(). Koha::Hold::set_waiting calculate expiration date from today instead of hold's waiting date.
Bug-12063---Remove-checking-of-ExpireReservesMaxPi.patch (text/plain), 2.43 KB, created by
Alex Arnaud
on 2017-05-04 08:56:49 UTC
(
hide
)
Description:
Bug 12063 - Remove checking of ExpireReservesMaxPickUpDelay in CancelExpiredReserves(). Koha::Hold::set_waiting calculate expiration date from today instead of hold's waiting date.
Filename:
MIME Type:
Creator:
Alex Arnaud
Created:
2017-05-04 08:56:49 UTC
Size:
2.43 KB
patch
obsolete
>From 08cc07a4c70db866121f4f6aeec3b5eb97992cdb Mon Sep 17 00:00:00 2001 >From: Alex Arnaud <alex.arnaud@biblibre.com> >Date: Thu, 4 May 2017 08:54:16 +0000 >Subject: [PATCH] Bug 12063 - Remove checking of ExpireReservesMaxPickUpDelay > in CancelExpiredReserves(). Koha::Hold::set_waiting calculate expiration date > from today instead of hold's waiting date. > >--- > C4/Reserves.pm | 1 - > Koha/Hold.pm | 2 +- > t/db_dependent/Holds/CancelReserves.t | 9 ++------- > 3 files changed, 3 insertions(+), 9 deletions(-) > >diff --git a/C4/Reserves.pm b/C4/Reserves.pm >index 4a34305..1d300f1 100644 >--- a/C4/Reserves.pm >+++ b/C4/Reserves.pm >@@ -940,7 +940,6 @@ Cancels all reserves with an expiration date from before today. > =cut > > sub CancelExpiredReserves { >- return unless C4::Context->preference("ExpireReservesMaxPickUpDelay"); > > my $today = dt_from_string(); > my $cancel_on_holidays = C4::Context->preference('ExpireReservesOnHolidays'); >diff --git a/Koha/Hold.pm b/Koha/Hold.pm >index 030e90a..d708054 100644 >--- a/Koha/Hold.pm >+++ b/Koha/Hold.pm >@@ -140,7 +140,7 @@ sub set_waiting { > $expirationdate->add(days => $max_pickup_delay); > > if ( C4::Context->preference("ExcludeHolidaysFromMaxPickUpDelay") ) { >- $expirationdate = $calendar->days_forward( dt_from_string($self->waitingdate), $max_pickup_delay ); >+ $expirationdate = $calendar->days_forward( dt_from_string(), $max_pickup_delay ); > } > > # If patron's requested expiration date is prior to the >diff --git a/t/db_dependent/Holds/CancelReserves.t b/t/db_dependent/Holds/CancelReserves.t >index 3330a1c..302b155 100644 >--- a/t/db_dependent/Holds/CancelReserves.t >+++ b/t/db_dependent/Holds/CancelReserves.t >@@ -8,7 +8,7 @@ use Koha::DateUtils; > use t::lib::Mocks; > use t::lib::TestBuilder; > >-use Test::More tests => 6; >+use Test::More tests => 5; > > use_ok('C4::Reserves'); > >@@ -63,12 +63,7 @@ my $reserve2 = $builder->build({ > > CancelExpiredReserves(); > my $r2 = Koha::Holds->find($reserve2->{reserve_id}); >-ok($r2, 'Without ExpireReservesMaxPickUpDelay, reserve 2 should not be canceled.'); >- >-t::lib::Mocks::mock_preference('ExpireReservesMaxPickUpDelay', 1); >-CancelExpiredReserves(); >-$r2 = Koha::Holds->find($reserve2->{reserve_id}); >-is($r2, undef,'With ExpireReservesMaxPickUpDelay, reserve 2 should be canceled.'); >+is($r2, undef,'reserve 2 should be canceled.'); > > # Reserve expired on holiday > my $reserve3 = $builder->build({ >-- >2.7.4
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 12063
:
26966
|
52558
|
52949
|
52950
|
53100
|
53101
|
59161
|
59162
|
59163
|
59165
|
61401
|
61440
|
61461
|
61735
|
62001
|
62002
|
62003
|
62004
|
62005
|
62474
|
63057
|
63091
|
63092
|
63093
|
63094
|
63095
|
63096
|
63097
|
63098
|
63099