Bugzilla – Attachment 152276 Details for
Bug 33795
Holds Queue builder should do cheap checks before expensive checks
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 33795: Holds Queue builder should do cheap checks before expensive checks
Bug-33795-Holds-Queue-builder-should-do-cheap-chec.patch (text/plain), 2.14 KB, created by
Kyle M Hall (khall)
on 2023-06-12 11:00:30 UTC
(
hide
)
Description:
Bug 33795: Holds Queue builder should do cheap checks before expensive checks
Filename:
MIME Type:
Creator:
Kyle M Hall (khall)
Created:
2023-06-12 11:00:30 UTC
Size:
2.14 KB
patch
obsolete
>From 20db4399cc768959eff4f7143ec448bd8a2f86be Mon Sep 17 00:00:00 2001 >From: Kyle M Hall <kyle@bywatersolutions.com> >Date: Mon, 22 May 2023 16:21:22 +0000 >Subject: [PATCH] Bug 33795: Holds Queue builder should do cheap checks before > expensive checks > >The holds queue builder runs many checks in a somewhat arbitrary order. We should order those checks such that the most expensive checks are at the end and can be avoided if a faster check fails. > >Test Plan: >1) prove t/db_dependent/HoldsQueue.t >2) Apply this patch >3) prove t/db_dependent/HoldsQueue.t >4) Tests still pass! > >Signed-off-by: Sam Lau <samalau@gmail.com> >--- > C4/HoldsQueue.pm | 10 ++++++---- > 1 file changed, 6 insertions(+), 4 deletions(-) > >diff --git a/C4/HoldsQueue.pm b/C4/HoldsQueue.pm >index 50feb8da6f..0dde1c5b0c 100644 >--- a/C4/HoldsQueue.pm >+++ b/C4/HoldsQueue.pm >@@ -596,10 +596,6 @@ sub MapItemsToHoldRequests { > > my $holding_branch_items = $items_by_branch{$holdingbranch}; > foreach my $item (@$holding_branch_items) { >- next unless $items_by_itemnumber{ $item->{itemnumber} }->{_object}->can_be_transferred( { to => $libraries->{ $request->{branchcode} } } ); >- >- # Don't fill item level holds that contravene the hold pickup policy at this time >- next unless _checkHoldPolicy($item, $request); > > # If hold itemtype is set, item's itemtype must match > next unless ( !$request->{itemtype} >@@ -612,6 +608,12 @@ sub MapItemsToHoldRequests { > && $item->{_object}->item_group->id eq $request->{item_group_id} ) > ); > >+ # Don't fill a hold with a non-transferrable item >+ next unless $items_by_itemnumber{ $item->{itemnumber} }->{_object}->can_be_transferred( { to => $libraries->{ $request->{branchcode} } } ); >+ >+ # Don't fill item level holds that contravene the hold pickup policy at this time >+ next unless _checkHoldPolicy($item, $request); >+ > $itemnumber = $item->{itemnumber}; > last; > } >-- >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 33795
:
151535
|
151654
| 152276