Bugzilla – Attachment 159017 Details for
Bug 31415
Script to automate converting holds to recalls
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 31415: Exclude found holds and fix hold ID call
Bug-31415-Exclude-found-holds-and-fix-hold-ID-call.patch (text/plain), 1.78 KB, created by
David Nind
on 2023-11-15 21:37:16 UTC
(
hide
)
Description:
Bug 31415: Exclude found holds and fix hold ID call
Filename:
MIME Type:
Creator:
David Nind
Created:
2023-11-15 21:37:16 UTC
Size:
1.78 KB
patch
obsolete
>From 37f810aadb33d901a744ff8c38c06af291f8f611 Mon Sep 17 00:00:00 2001 >From: Aleisha Amohia <aleisha@catalyst.net.nz> >Date: Wed, 15 Nov 2023 20:49:06 +0000 >Subject: [PATCH] Bug 31415: Exclude found holds and fix hold ID call > >Signed-off-by: David Nind <david@davidnind.com> >--- > misc/cronjobs/recalls/convert_holds_to_recalls.pl | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > >diff --git a/misc/cronjobs/recalls/convert_holds_to_recalls.pl b/misc/cronjobs/recalls/convert_holds_to_recalls.pl >index 79bd0f9bc0..90669f998e 100755 >--- a/misc/cronjobs/recalls/convert_holds_to_recalls.pl >+++ b/misc/cronjobs/recalls/convert_holds_to_recalls.pl >@@ -92,7 +92,7 @@ foreach my $bib ( @bib_holds ) { > if ( $bib->{bibcount} >= $min ) { > # If there are $min or more holds on the same record, convert the oldest hold to a recall > >- my @holds = Koha::Holds->search({ biblionumber => $bib->{biblionumber} }, { order_by => { -asc => 'reservedate' } })->as_list; >+ my @holds = Koha::Holds->search({ biblionumber => $bib->{biblionumber}, found => undef }, { order_by => { -asc => 'reservedate' } })->as_list; > my $hold_to_convert = $holds[0]; > foreach my $res ( @holds ) { > if ( dt_from_string($res->reservedate) < dt_from_string($hold_to_convert->reservedate) ) { >@@ -126,7 +126,7 @@ foreach my $bib ( @bib_holds ) { > $hold_to_convert->cancel({ cancellation_reason => 'RECALLED' }); > $count++; > if ( $verbose ) { >- my $hold_id = $hold_to_convert->hold_id; >+ my $hold_id = $hold_to_convert->reserve_id; > my $biblionumber = $hold_to_convert->biblionumber; > print "$count. Hold converted to recall (hold_id: $hold_id, biblionumber: $biblionumber).\n"; > } >-- >2.30.2
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 31415
:
139440
|
139441
|
139646
|
139737
|
145796
|
148112
|
157002
|
159010
|
159016
| 159017