Bugzilla – Attachment 151387 Details for
Bug 33761
Holds queue is not selecting items with completed transfers
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 33761: Alter query to remove items with active transfers from available list
Bug-33761-Alter-query-to-remove-items-with-active-.patch (text/plain), 2.45 KB, created by
Nick Clemens (kidclamp)
on 2023-05-18 11:12:43 UTC
(
hide
)
Description:
Bug 33761: Alter query to remove items with active transfers from available list
Filename:
MIME Type:
Creator:
Nick Clemens (kidclamp)
Created:
2023-05-18 11:12:43 UTC
Size:
2.45 KB
patch
obsolete
>From 26b9f5d19b23e5c68cb989e0c77e4b33fa4fab9e Mon Sep 17 00:00:00 2001 >From: Nick Clemens <nick@bywatersolutions.com> >Date: Thu, 18 May 2023 11:09:18 +0000 >Subject: [PATCH] Bug 33761: Alter query to remove items with active transfers > from available list > >Current code removes all items without an active transfer, and any with completed transfers. > >This patch moves the conditionals for transfers into the join, then adds a new >condition to remove items with active transfers. > >To test: >1 - Apply unit test patch only >2 - prove -v t/db_dependent/HoldsQueue.t >3 - It fails >4 - Apply second patch >5 - prove -v t/db_dependent/HoldsQueue.t >6 - Success! >--- > C4/HoldsQueue.pm | 10 ++++++---- > 1 file changed, 6 insertions(+), 4 deletions(-) > >diff --git a/C4/HoldsQueue.pm b/C4/HoldsQueue.pm >index 2beb38afe0..4884f6570e 100644 >--- a/C4/HoldsQueue.pm >+++ b/C4/HoldsQueue.pm >@@ -326,13 +326,14 @@ sub GetItemsAvailableToFillHoldRequestsForBib { > $items_query .= "JOIN biblioitems USING (biblioitemnumber) > LEFT JOIN itemtypes USING (itemtype) "; > } >- $items_query .= " LEFT JOIN branchtransfers ON (items.itemnumber = branchtransfers.itemnumber)"; >+ $items_query .= " LEFT JOIN branchtransfers ON ( >+ items.itemnumber = branchtransfers.itemnumber >+ AND branchtransfers.datearrived IS NULL AND branchtransfers.datecancelled IS NULL >+ )"; > $items_query .= " WHERE items.notforloan = 0 > AND holdingbranch IS NOT NULL > AND itemlost = 0 > AND withdrawn = 0"; >- $items_query .= " AND branchtransfers.datearrived IS NULL >- AND branchtransfers.datecancelled IS NULL"; > $items_query .= " AND damaged = 0" unless C4::Context->preference('AllowHoldsOnDamagedItems'); > $items_query .= " AND items.onloan IS NULL > AND (itemtypes.notforloan IS NULL OR itemtypes.notforloan = 0) >@@ -343,7 +344,8 @@ sub GetItemsAvailableToFillHoldRequestsForBib { > AND itemnumber IS NOT NULL > AND (found IS NOT NULL OR priority = 0) > ) >- AND items.biblionumber = ?"; >+ AND items.biblionumber = ? >+ AND branchtransfers.itemnumber IS NULL"; > > my @params = ($biblionumber, $biblionumber); > if ($branches_to_use && @$branches_to_use) { >-- >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 33761
:
151386
|
151387
|
151413
|
151414