From 58c765c492c14d7b311eb5102684fd594317a5fd Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Fri, 1 Oct 2021 15:55:33 +0200 Subject: [PATCH] Revert "Bug 28510: Remove unnecessary conditional" This reverts commit d284735d05f67226feba1b4b9e7bf17259eaabaf. The following test was failing randomly: # Failed test 'take from lowest cost branch (don't use cost matrix) holding branch' # at t/db_dependent/HoldsQueue.t line 1494. # got: 'LHKtxLk' # expected: 'JL9C_OR' # Wrong pick-up/hold for first target (pick_branch, hold_branch, reserves, hold_fill_targets, tmp_holdsqueue) Signed-off-by: Jonathan Druart --- C4/HoldsQueue.pm | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/C4/HoldsQueue.pm b/C4/HoldsQueue.pm index b61562885f..b4d2b026f2 100644 --- a/C4/HoldsQueue.pm +++ b/C4/HoldsQueue.pm @@ -596,7 +596,12 @@ sub MapItemsToHoldRequests { } unless ($itemnumber) { - $pull_branches = [keys %items_by_branch]; + # not found yet, fall back to basics + if ($branches_to_use) { + $pull_branches = $branches_to_use; + } else { + $pull_branches = [keys %items_by_branch]; + } # Try picking items where the home and pickup branch match first PULL_BRANCHES: -- 2.39.2