Bugzilla – Attachment 151535 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.18 KB, created by
Kyle M Hall (khall)
on 2023-05-22 16:24:23 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-05-22 16:24:23 UTC
Size:
2.18 KB
patch
obsolete
>From 96096b0c181f66b4e0caafb998a3395e03643817 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! >--- > C4/HoldsQueue.pm | 10 ++++++---- > 1 file changed, 6 insertions(+), 4 deletions(-) > >diff --git a/C4/HoldsQueue.pm b/C4/HoldsQueue.pm >index 4884f6570e..84cf407a0b 100644 >--- a/C4/HoldsQueue.pm >+++ b/C4/HoldsQueue.pm >@@ -597,10 +597,6 @@ sub MapItemsToHoldRequests { > my $holding_branch_items = $items_by_branch{$holdingbranch}; > foreach my $item (@$holding_branch_items) { > next if $request->{borrowerbranch} ne $item->{$priority_branch}; >- 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} >@@ -613,6 +609,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