Bugzilla – Attachment 134972 Details for
Bug 30337
Holds to pull ( pendingreserves.pl ) ignores holds if priority 1 hold is suspended
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 30337: Holds to Pull ( pendingreserves.pl ) ignores holds if priority 1 hold is suspended
Bug-30337-Holds-to-Pull--pendingreservespl--ignore.patch (text/plain), 2.69 KB, created by
Caroline Cyr La Rose
on 2022-05-13 13:38:07 UTC
(
hide
)
Description:
Bug 30337: Holds to Pull ( pendingreserves.pl ) ignores holds if priority 1 hold is suspended
Filename:
MIME Type:
Creator:
Caroline Cyr La Rose
Created:
2022-05-13 13:38:07 UTC
Size:
2.69 KB
patch
obsolete
>From d5a25301422dd6e1be9118e61f629a2d98468508 Mon Sep 17 00:00:00 2001 >From: Kyle Hall <kyle@bywatersolutions.com> >Date: Tue, 22 Mar 2022 14:14:52 -0400 >Subject: [PATCH] Bug 30337: Holds to Pull ( pendingreserves.pl ) ignores holds > if priority 1 hold is suspended > >Holds to Pull ( pendingreserves.pl ) ignores holds if priority 1 hold is suspended, >and shows the wrong number of "patrons with holds" which presumably tells the >librarian how many copies to pull from the shelves. > >Test Plan: >1) Create a record with one or more holdable items >2) Place two holds on the record >3) Note they show in the holds to pull report >4) Suspend the priority 2 hold >5) Note the report continues showing that 2 patrons have holds >6) Resume the priority 2 hold >7) Suspend the priority 1 hold >8) Note the hold disappears from the holds to pull report >9) Apply this patch >10) Restart all the things! >11) Reload the holds to pull report >12) The report should show one hold that needs an item pulled to fill it! > >Signed-off-by: David Nind <david@davidnind.com> >Signed-off-by: Caroline Cyr La Rose <caroline.cyr-la-rose@inlibro.com> >--- > circ/pendingreserves.pl | 10 +++++++--- > 1 file changed, 7 insertions(+), 3 deletions(-) > >diff --git a/circ/pendingreserves.pl b/circ/pendingreserves.pl >index 85bcffeb2d..1f853554b5 100755 >--- a/circ/pendingreserves.pl >+++ b/circ/pendingreserves.pl >@@ -156,7 +156,7 @@ unless ( $enddate ) { > # building query parameters > my %where = ( > 'me.found' => undef, >- 'me.priority' => 1, >+ 'me.priority' => { '!=' => 0 }, > 'me.suspend' => 0, > 'itembib.itemlost' => 0, > 'itembib.withdrawn' => 0, >@@ -188,7 +188,7 @@ if ( C4::Context->preference('IndependentBranches') ){ > # get all distinct unfulfilled reserves > my $holds = Koha::Holds->search( > { %where }, >- { join => 'itembib', distinct => 1, columns => qw[me.biblionumber] } >+ { join => 'itembib', distinct => 1, columns => qw[me.biblionumber] } > ); > my @biblionumbers = $holds->get_column('biblionumber'); > >@@ -202,7 +202,7 @@ if ( $holds->count ) { > # patrons count per biblio > my $patrons_count = { > map { $_->{biblionumber} => $_->{patrons_count} } @{ Koha::Holds->search( >- {}, >+ { 'suspend' => 0 }, > { > select => [ 'biblionumber', { count => { distinct => 'borrowernumber' } } ], > as => [qw( biblionumber patrons_count )], >@@ -235,7 +235,11 @@ my $all_holds = { > > # make final holds_info array and fill with info > my @holds_info; >+my $seen = {}; > foreach my $bibnum ( @biblionumbers ){ >+ # Skip this record if it's already been handled >+ next if $seen->{$bibnum}; >+ $seen->{$bibnum} = 1; > > my $hold_info; > my $items = $all_items->{$bibnum}; >-- >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 30337
:
132032
|
132033
|
134568
|
134972
|
135213