From 3f3d38f6e6b13734d3ec811e60834ee92abb988e Mon Sep 17 00:00:00 2001 From: Nick Clemens Date: Wed, 30 Aug 2023 18:38:56 +0000 Subject: [PATCH] Bug 34666: Allow item_group to be null and still match The current logic requires that the grop ids match, but this eliminates null matches from the group. The fallout essentially is that the queue won't be checked to fill holds in cases of title level matches where holds don't have an item group id. The queue checks the transport cost matrix while the check reserves check does not, so this may have an impact on holds costs and delivery times To test: 0 - Apply unit test patch 1 - prove -v t/db_dependent/Reserves.t 2 - It fails 3 - Apply this patch 4 - prove -v t/db_dependent/Reserves.t 5 - It passes! Signed-off-by: David Nind Signed-off-by: Marcel de Rooy Signed-off-by: Tomas Cohen Arazi (cherry picked from commit fe3872f62885b4b0ee483e446c0b2b85e74970f7) Signed-off-by: Fridolin Somers (cherry picked from commit f4641ea97228966cc5b7a54e1bfda2778b4d1a3b) Signed-off-by: Matt Blenkinsop --- C4/Reserves.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/C4/Reserves.pm b/C4/Reserves.pm index 1a2d77f835..7efd3744ab 100644 --- a/C4/Reserves.pm +++ b/C4/Reserves.pm @@ -1799,7 +1799,7 @@ sub _Findgroupreserve { AND hold_fill_targets.itemnumber = ? AND reservedate <= DATE_ADD(NOW(),INTERVAL ? DAY) AND suspend = 0 - AND reserves.item_group_id = item_group_items.item_group_id + AND (reserves.item_group_id = item_group_items.item_group_id OR reserves.item_group_id IS NULL) ORDER BY priority }; $sth = $dbh->prepare($title_level_target_query); -- 2.20.1