Bugzilla – Attachment 136797 Details for
Bug 30580
GetItemsAvailableToFillHoldRequestsForBib should get transfers during initial query
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 30580: Don't use GetTransfers in GetItemsAvailableToFillHoldRequestsForBib
Bug-30580-Dont-use-GetTransfers-in-GetItemsAvailab.patch (text/plain), 2.47 KB, created by
Michal Urban
on 2022-06-30 21:34:19 UTC
(
hide
)
Description:
Bug 30580: Don't use GetTransfers in GetItemsAvailableToFillHoldRequestsForBib
Filename:
MIME Type:
Creator:
Michal Urban
Created:
2022-06-30 21:34:19 UTC
Size:
2.47 KB
patch
obsolete
>From d59bd8df126a3bd153766ab5d4bd9d70c7294592 Mon Sep 17 00:00:00 2001 >From: Nick Clemens <nick@bywatersolutions.com> >Date: Thu, 21 Apr 2022 13:21:12 +0000 >Subject: [PATCH] Bug 30580: Don't use GetTransfers in > GetItemsAvailableToFillHoldRequestsForBib > >This patch simply moves the check for transfers into the initial query > >Test result: Works as intended > >To test: >1 - Place some holds that show in the holds queue >2 - Add a manual transfer to one item >3 - Confirm it no longer hsows in the queue >4 - Apply patch >5 - Confirm item still does not appear in the queue > >Signed-off-by: Michal Urban <michalurban177@gmail.com> >--- > C4/HoldsQueue.pm | 12 +++++++----- > 1 file changed, 7 insertions(+), 5 deletions(-) > >diff --git a/C4/HoldsQueue.pm b/C4/HoldsQueue.pm >index f2eb1ee4b8..f9367b2389 100644 >--- a/C4/HoldsQueue.pm >+++ b/C4/HoldsQueue.pm >@@ -315,7 +315,8 @@ sub GetItemsAvailableToFillHoldRequestsForBib { > > my $dbh = C4::Context->dbh; > my $items_query = "SELECT itemnumber, homebranch, holdingbranch, itemtypes.itemtype AS itype >- FROM items "; >+ FROM items >+ LEFT JOIN branchtransfers USING (itemnumber)"; > > if (C4::Context->preference('item-level_itypes')) { > $items_query .= "LEFT JOIN itemtypes ON (itemtypes.itemtype = items.itype) "; >@@ -337,7 +338,9 @@ sub GetItemsAvailableToFillHoldRequestsForBib { > AND itemnumber IS NOT NULL > AND (found IS NOT NULL OR priority = 0) > ) >- AND items.biblionumber = ?"; >+ AND items.biblionumber = ? >+ AND branchtransfers.datearrived IS NULL >+ AND branchtransfers.datecancelled IS NULL"; > > my @params = ($biblionumber, $biblionumber); > if ($branches_to_use && @$branches_to_use) { >@@ -347,13 +350,12 @@ sub GetItemsAvailableToFillHoldRequestsForBib { > my $sth = $dbh->prepare($items_query); > $sth->execute(@params); > >- my $itm = $sth->fetchall_arrayref({}); >- my @items = grep { ! scalar C4::Circulation::GetTransfers($_->{itemnumber}) } @$itm; >+ my $items = $sth->fetchall_arrayref({}); > return [ grep { > my $rule = C4::Circulation::GetBranchItemRule($_->{homebranch}, $_->{itype}); > $_->{holdallowed} = $rule->{holdallowed}; > $_->{hold_fulfillment_policy} = $rule->{hold_fulfillment_policy}; >- } @items ]; >+ } @$items ]; > } > > =head2 _checkHoldPolicy >-- >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 30580
:
133560
|
136797
|
139129
|
139130