Revert "Bug 28510: Remove unnecessary conditional"

This reverts commit d284735d05.

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 <jonathan.druart@bugs.koha-community.org>
This commit is contained in:
Jonathan Druart 2021-10-01 15:55:33 +02:00
parent c7eb047126
commit 58c765c492

View file

@ -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: