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 <david@davidnind.com>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
This commit is contained in:
Nick Clemens 2023-08-30 18:38:56 +00:00 committed by Tomas Cohen Arazi
parent 99d7e55be6
commit fe3872f628
No known key found for this signature in database
GPG Key ID: 0A272EA1B2F3C15F
1 changed files with 1 additions and 1 deletions

View File

@ -1782,7 +1782,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);