Bug 14549: Check patrons reserves for any holds on a bib when checking out an item
MoveReserve uses CheckReserves to see if the current patron has any holds
on the title they are checking out, however, CheckReserves doesn't return
all holds on a biblio, it returns holds on the item from the holdsqueue
if they exist
This can create a condition where we check holds on an item, find we have it planned for
another borrower, confirm checkout to the current borrower, but don't fill their hold
To test:
1) Find record
2) place record level holds for 2 different patrons (record level)
3) Run holds queue builder, check the queue to confirm an item was selected for patron 1
Circulation->Holds queue->Library="All"
4) Check out the item queued for patron with priority 1 to the second patron
5) You should be asked to confirm, do so
6) Note the item checks out, but both holds remain
7) Apply patch
8) Check in the item
9) Don't confirm the hold
10) Check the holds on the record and the holds queue
11) Patron 1 should be priority 1 with an item selected from the holds queue
12) Checkout to patron 2 as before
13) Note the hold for patron 2 is filled this time
14) Prove -v t/db_dependent/Reserves.t
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit
36ee00ed952ed9081eeeca5e98fe006fbaa12db6)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>