Bug 37774 - Title level hold should fill even if specific item is not holdable
Summary: Title level hold should fill even if specific item is not holdable
Status: In Discussion
Alias: None
Product: Koha
Classification: Unclassified
Component: Hold requests (show other bugs)
Version: Main
Hardware: All All
: P5 - low major
Assignee: Nick Clemens (kidclamp)
QA Contact: Testopia
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-08-29 11:22 UTC by Nick Clemens (kidclamp)
Modified: 2024-09-16 13:46 UTC (History)
5 users (show)

See Also:
Change sponsored?: ---
Patch complexity: ---
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:
Circulation function:


Attachments
Bug 37774: Unit tests (2.50 KB, patch)
2024-08-30 12:36 UTC, Nick Clemens (kidclamp)
Details | Diff | Splinter Review
Bug 37774: Make MoveReserve check for patron holds even if none found by CheckReserve (4.33 KB, patch)
2024-08-30 12:36 UTC, Nick Clemens (kidclamp)
Details | Diff | Splinter Review
Bug 37774: Unit tests (2.55 KB, patch)
2024-09-13 15:36 UTC, Brendan Lawlor
Details | Diff | Splinter Review
Bug 37774: Make MoveReserve check for patron holds even if none found by CheckReserve (4.38 KB, patch)
2024-09-13 15:36 UTC, Brendan Lawlor
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Nick Clemens (kidclamp) 2024-08-29 11:22:15 UTC
When a patron has a hold on a title that has a mix of holdable and unholdable items we will not fill the hold if the unholdable items are checked out.

This is similar to bug 4850, but that seems to be about the check-in response, this is to solve the checkout handling

To recreate:
1 - Set a "Default holds policy by item type" rule on "Mixed materials" to "No holds allowed"
2 - Add a Mixed Materials item on a record with items of 'Book' item types that are holdable
3 - Place a hold for a patron
4 - Check out the 'Mixed material' book to the patron (they are allowed to borrow these materials)
5 - The hold is not marked filled!

It is common for libraries to have 'New items' or 'Lucky day' items that are nto holdable, but can be checked out by the patron if found on the shelf. Koha should fill the hold when issuing even if the item would not normally be holdable
Comment 1 Nick Clemens (kidclamp) 2024-08-30 12:36:14 UTC
Created attachment 170906 [details] [review]
Bug 37774: Unit tests
Comment 2 Nick Clemens (kidclamp) 2024-08-30 12:36:16 UTC
Created attachment 170907 [details] [review]
Bug 37774: Make MoveReserve check for patron holds even if none found by CheckReserve

This patch moves the check for a patron's holds so that even if CheckReserve does not find the hold
due to hold policies it can still be filled.
The check will respect 'ConfirmFutureHolds' as per existing tests

1 - Set a "Default holds policy by item type" rule on "Mixed materials" to "No holds allowed"
2 - Add a Mixed Materials item on a record with items of 'Book' item types that are holdable
3 - Place a hold for a patron
4 - Check out the 'Mixed material' book to the patron (they are allowed to borrow these materials)
5 - The hold is not marked filled! Boo
6 - Check in the item and check out again
7 - The hold is filled! Yay
8 - Place another hold for the patron, with a future date set
9 - Checkout the item
10 - The hold is not filled! Yay
11 - Set 'ConfirmFutureHolds' to include the future hold placed above
12 - Checkin and checkout the item
13 - The hold is filled! Yay
Comment 3 Brendan Lawlor 2024-09-13 15:36:31 UTC
Created attachment 171483 [details] [review]
Bug 37774: Unit tests

Signed-off-by: Brendan Lawlor <blawlor@clamsnet.org>
Comment 4 Brendan Lawlor 2024-09-13 15:36:32 UTC
Created attachment 171484 [details] [review]
Bug 37774: Make MoveReserve check for patron holds even if none found by CheckReserve

This patch moves the check for a patron's holds so that even if CheckReserve does not find the hold
due to hold policies it can still be filled.
The check will respect 'ConfirmFutureHolds' as per existing tests

1 - Set a "Default holds policy by item type" rule on "Mixed materials" to "No holds allowed"
2 - Add a Mixed Materials item on a record with items of 'Book' item types that are holdable
3 - Place a hold for a patron
4 - Check out the 'Mixed material' book to the patron (they are allowed to borrow these materials)
5 - The hold is not marked filled! Boo
6 - Check in the item and check out again
7 - The hold is filled! Yay
8 - Place another hold for the patron, with a future date set
9 - Checkout the item
10 - The hold is not filled! Yay
11 - Set 'ConfirmFutureHolds' to include the future hold placed above
12 - Checkin and checkout the item
13 - The hold is filled! Yay

Signed-off-by: Brendan Lawlor <blawlor@clamsnet.org>
Comment 5 Brendan Lawlor 2024-09-13 15:38:36 UTC
Testing notes:
Step 5.5 - Apply patch
Step 10.5 - Set AllowHoldDateInFuture to Allow
Comment 6 Hanna Dehlin 2024-09-16 12:16:18 UTC
This patch breaks wanted behavior for our library. 
An item that is not holdable should not be able to fill a hold.

For example: We are a university library and for many of our titles we have two itemtypes: dayloan (not holdable, 1-day loan) and course literature (holdable, 3-week loan). A patron should be able to place and keep a hold for the course literature items and still be able to check out the dayloan item.
Comment 7 Stefan Berndtsson 2024-09-16 13:46:37 UTC
Agreeing with Hanna. This should have a separate option instead of "No holds allowed" to trigger this behaviour. Something like "Fillable but no holds allowed" (except with a better label) for the specific combination of circulation rules that's relevant for the situation.

I'm preemptively moving this to In Discussion since this patch may disrupt existing processes for a lot of libraries.