Bug 24359 - Remove items from Holds Queue when checked in
Summary: Remove items from Holds Queue when checked in
Status: Failed QA
Alias: None
Product: Koha
Classification: Unclassified
Component: Hold requests (show other bugs)
Version: master
Hardware: All All
: P5 - low enhancement with 8 votes (vote)
Assignee: Agustín Moyano
QA Contact: Kyle M Hall
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-01-06 22:34 UTC by Joy Nelson
Modified: 2021-02-24 20:14 UTC (History)
7 users (show)

See Also:
Change sponsored?: ---
Patch complexity: Trivial patch
Text to go in the release notes:
Version(s) released in:


Attachments
Bug 24359: Add test (2.80 KB, patch)
2020-10-28 14:05 UTC, Agustín Moyano
Details | Diff | Splinter Review
Bug 24359: Remove hold from holds queue when captured (1.83 KB, patch)
2020-10-28 14:05 UTC, Agustín Moyano
Details | Diff | Splinter Review
Bug 24359: Add test (2.86 KB, patch)
2020-12-15 09:18 UTC, Martin Renvoize
Details | Diff | Splinter Review
Bug 24359: Remove hold from holds queue when captured (1.89 KB, patch)
2020-12-15 09:19 UTC, Martin Renvoize
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Joy Nelson 2020-01-06 22:34:20 UTC
Currently, if an item is checked in and the hold is triggered/captured, the item will not come off the holds queue until the the cronjob runs again.  This causes some confusion for multibranch systems when other branches attempt to fill holds that have already been filled.

Proposal: Remove bib/items from the Holds Queue after checkin and before the next holds queue cron runs to update the holds queue.
Comment 1 AspenCat Team 2020-05-18 20:54:17 UTC
This would be very helpful to AspenCat.
Comment 2 Sally 2020-08-14 08:14:38 UTC
This would be a fantastic addition to Koha.
Comment 3 Agustín Moyano 2020-10-28 14:05:09 UTC
Created attachment 112641 [details] [review]
Bug 24359: Add test
Comment 4 Agustín Moyano 2020-10-28 14:05:12 UTC
Created attachment 112642 [details] [review]
Bug 24359: Remove hold from holds queue when captured

This patch removes a hold from holds queue when captured by check in.

To test:

1. check out an item from a book with multiple items for patron_1
2. place a biblio level hold for patron_2
3. perl misc/cronjobs/holds/build_holds_queue.pl
CHECK => holds queue shows the placed hold
4. check in the item from step 1 and confirm hold for patron_2
SUCCESS => hold for patron_2 is no longer in holds queue
5. prove t/db_dependent/HoldsQueue.t
Comment 5 Kelly McElligott 2020-12-10 01:03:28 UTC
Hi,
I have gone through your test plan and at step 4- after checking the item in and confirming the hold, the item does not get removed from the Holds Queue, instead, the hold stays on the Holds queue, but the item also shows waiting for the patron.
Comment 6 Martin Renvoize 2020-12-15 09:18:59 UTC
Created attachment 114405 [details] [review]
Bug 24359: Add test

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Comment 7 Martin Renvoize 2020-12-15 09:19:03 UTC
Created attachment 114406 [details] [review]
Bug 24359: Remove hold from holds queue when captured

This patch removes a hold from holds queue when captured by check in.

To test:

1. check out an item from a book with multiple items for patron_1
2. place a biblio level hold for patron_2
3. perl misc/cronjobs/holds/build_holds_queue.pl
CHECK => holds queue shows the placed hold
4. check in the item from step 1 and confirm hold for patron_2
SUCCESS => hold for patron_2 is no longer in holds queue
5. prove t/db_dependent/HoldsQueue.t

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Comment 8 Martin Renvoize 2020-12-15 09:19:20 UTC
I like this, all works as expected, signing off.
Comment 9 Kyle M Hall 2021-02-24 20:14:20 UTC
Unit tests are failing:

root@kohadevbox:koha(bug24359-qa)$ prove t/db_dependent/HoldsQueue.t 
t/db_dependent/HoldsQueue.t .. 56/57 
    #   Failed test 'Holds queue has one element'
    #   at t/db_dependent/HoldsQueue.t line 1712.
    #          got: '2'
    #     expected: '1'

    #   Failed test 'Holds queue has no elements, even when queue was not rebuilt'
    #   at t/db_dependent/HoldsQueue.t line 1722.
    #          got: '1'
    #     expected: '0'
t/db_dependent/HoldsQueue.t .. 57/57     # Looks like you failed 2 tests of 2.

#   Failed test 'Remove holds on check-in match'
#   at t/db_dependent/HoldsQueue.t line 1726.
# Looks like you failed 1 test of 57.
t/db_dependent/HoldsQueue.t .. Dubious, test returned 1 (wstat 256, 0x100)
Failed 1/57 subtests 

Test Summary Report
-------------------
t/db_dependent/HoldsQueue.t (Wstat: 256 Tests: 57 Failed: 1)
  Failed test:  57
  Non-zero exit status: 1
Files=1, Tests=57, 10 wallclock secs ( 0.03 usr  0.00 sys +  5.82 cusr  0.97 csys =  6.82 CPU)
Result: FAIL