Bugzilla – Attachment 67993 Details for
Bug 19260
Reservations / holds marked as problems being seen as expired ones and deleted wrongly.
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
[17.05] Bug 19260: Holds marked as problems being seen as expired ones and deleted wrongly
1705-Bug-19260-Holds-marked-as-problems-being-seen.patch (text/plain), 2.23 KB, created by
Josef Moravec
on 2017-10-12 12:10:15 UTC
(
hide
)
Description:
[17.05] Bug 19260: Holds marked as problems being seen as expired ones and deleted wrongly
Filename:
MIME Type:
Creator:
Josef Moravec
Created:
2017-10-12 12:10:15 UTC
Size:
2.23 KB
patch
obsolete
>From f9a5cc43e082957489f52cbc3d9afe528c373d0b Mon Sep 17 00:00:00 2001 >From: Josef Moravec <josef.moravec@gmail.com> >Date: Thu, 5 Oct 2017 20:37:25 +0000 >Subject: [PATCH] [17.05] Bug 19260: Holds marked as problems being seen as > expired ones and deleted wrongly > >Test plan: >0) Apply just the first patch - the one with test >1) Run t/db_dependent/Reserves.t - test for CancelExpiredReserves should >fail >2) Apply the second patch >3) t/db_dependent/Reserves.t should pass now > >Followed test plan, patch worked as described. Passes QA test tool > >Signed-off-by: Alex Buckley <alexbuckley@catalyst.net.nz> > >Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> >--- > C4/Reserves.pm | 22 +++++++++++++--------- > 1 file changed, 13 insertions(+), 9 deletions(-) > >diff --git a/C4/Reserves.pm b/C4/Reserves.pm >index 9ea9179..be144d2 100644 >--- a/C4/Reserves.pm >+++ b/C4/Reserves.pm >@@ -879,21 +879,25 @@ sub CancelExpiredReserves { > > my $today = dt_from_string(); > my $cancel_on_holidays = C4::Context->preference('ExpireReservesOnHolidays'); >+ my $expireWaiting = C4::Context->preference('ExpireReservesMaxPickUpDelay'); > > my $dbh = C4::Context->dbh; >- my $sth = $dbh->prepare( " >- SELECT * FROM reserves WHERE DATE(expirationdate) < DATE( CURDATE() ) >- AND expirationdate IS NOT NULL >- " ); >- $sth->execute(); > >- while ( my $res = $sth->fetchrow_hashref() ) { >- my $calendar = Koha::Calendar->new( branchcode => $res->{'branchcode'} ); >- my $cancel_params = { reserve_id => $res->{'reserve_id'} }; >+ my $dtf = Koha::Database->new->schema->storage->datetime_parser; >+ >+ my $params = { expirationdate => { '<', $dtf->format_date($today) } }; >+ >+ $params->{found} = undef unless $expireWaiting; >+ >+ # FIXME To move to Koha::Holds->search_expired (?) >+ my $holds = Koha::Holds->search( $params ); > >+ while ( my $hold = $holds->next ) { >+ my $calendar = Koha::Calendar->new( branchcode => $hold->branchcode ); > next if !$cancel_on_holidays && $calendar->is_holiday( $today ); > >- if ( $res->{found} eq 'W' ) { >+ my $cancel_params = { reserve_id => $hold->reserve_id }; >+ if ( $hold->found eq 'W' ) { > $cancel_params->{charge_cancel_fee} = 1; > } > >-- >2.1.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 19260
:
67428
|
67489
|
67653
|
67654
|
67659
|
67660
|
67677
|
67678
|
67679
|
67680
|
67733
|
67992
| 67993 |
67994
|
67995