Bug 39846

Summary: Holds Queue Local Holds Priority checks items after an item has been allocated
Product: Koha Reporter: Lisette Scheer <lisette>
Component: Hold requestsAssignee: Bugs List <koha-bugs>
Status: NEW --- QA Contact: Testopia <testopia>
Severity: normal    
Priority: P5 - low CC: gmcharlt
Version: Main   
Hardware: All   
OS: All   
GIT URL: Change sponsored?: ---
Patch complexity: --- Documentation contact:
Documentation submission: Text to go in the release notes:
Version(s) released in:
Circulation function:

Description Lisette Scheer 2025-05-06 20:30:48 UTC
foreach my $request (@$hold_requests) {
...
                foreach my $item (@$available_items) {
...
                    if ($local_hold_match) 
                        if (    exists $items_by_itemnumber{ $item->{itemnumber} }
                            and not exists $allocated_items{ $item->{itemnumber} }
                            and not $request->{allocated} )
                        {


This code checks each item for local holds priority and then goes to the next item if request is already allocated, but we should check earlier in the loop and go to the next request if the first one is already filled.