It is a regression from bug 38650 that issuing non-holdable items now fills holds. The subroutine C4::Reserves::MoveReserve would previously only do anything if there where a hold that had been filled with the specified item, which mean that the item issued was holdable. But bug 38650 opened up the possibility to fill the borrowers hold even if the issued item is not holdable. I suggest a check that the item issued is holdable if the biblio is reserved by the borrower.
Created attachment 186376 [details] [review] Bug 40792: Do not fill holds with non-reservable items. Verify that the item issued is reservable before filling the patron's hold. 1. Go to circulation and fine rules and add a rule for an itemtype that can be issued, for instance "Maps" in koha-testing-docker, with 0 in the column "Holds per record (count)". 2. Go to any biblio where there are items that may be reserved. Create an item with the above created item type and give it a barcode, e.g., 'tempbarcode'. 3. Place a hold for any patron (for instance 23529000120056 in koha-testing-docker). 4. Issue the item 'tempbarcode' to the patron with the hold. 5. Make sure the hold remains. 6. Create a new hold to another borrower (for instance 23529000197047), and make sure this new hold has priority 2. 7. Return the item 'tempbarcode' and issue it to the second patron. 8. Make sure both holds remain.
Tested in production environment, works as expected. Great work! Note: this is to enable patrons to have a title level reservation on a title that has multiple item types, one type that is allowed to fill a hold (normal loan) and one type that is not allowed to fill a hold (might be short-time loan etc). Patrons must be able to keep their title level reservation on normal loan item type while they can check out the short-time item type.