Bug 30580

Summary: GetItemsAvailableToFillHoldRequestsForBib should get transfers during initial query
Product: Koha Reporter: Nick Clemens <nick>
Component: Hold requestsAssignee: Nick Clemens <nick>
Status: RESOLVED DUPLICATE QA Contact: Testopia <testopia>
Severity: normal    
Priority: P5 - low CC: fridolin.somers, gmcharlt, joonas.kylmala, michalurban177
Version: Main   
Hardware: All   
OS: All   
See Also: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=33761
Change sponsored?: --- Patch complexity: Small patch
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
Attachments: Bug 30580: Don't use GetTransfers in GetItemsAvailableToFillHoldRequestsForBib
Bug 30580: Don't use GetTransfers in GetItemsAvailableToFillHoldRequestsForBib
Bug 30580: Unit test
Bug 30580: Don't use GetTransfers in GetItemsAvailableToFillHoldRequestsForBib

Description Nick Clemens 2022-04-21 13:20:31 UTC
Currently we get the items, then loop over them checking for transfers - we can simply join to branch transfers in the initial query
Comment 1 Nick Clemens 2022-04-21 13:22:30 UTC
Created attachment 133560 [details] [review]
Bug 30580: Don't use GetTransfers in GetItemsAvailableToFillHoldRequestsForBib

This patch simply moves the check for transfers into the initial query

To test:
1 - Place some holds that show in the holds queue
2 - Add a manual transfer to one item
3 - Confirm it no longer hsows in the queue
4 - Apply patch
5 - Confirm item still does not appear in the queue
Comment 2 Michal Urban 2022-06-30 21:34:19 UTC
Created attachment 136797 [details] [review]
Bug 30580: Don't use GetTransfers in GetItemsAvailableToFillHoldRequestsForBib

This patch simply moves the check for transfers into the initial query

Test result: Works as intended

To test:
1 - Place some holds that show in the holds queue
2 - Add a manual transfer to one item
3 - Confirm it no longer hsows in the queue
4 - Apply patch
5 - Confirm item still does not appear in the queue

Signed-off-by: Michal Urban <michalurban177@gmail.com>
Comment 3 Fridolin Somers 2022-08-13 06:47:01 UTC
Arf method GetItemsAvailableToFillHoldRequestsForBib does not have a unit test yet.
Please create one.
It will ensure this change is harmless.
Comment 4 Katrin Fischer 2022-08-13 20:05:49 UTC
Setting to Failed QA to make this show on Nick's radar :)
Comment 5 Nick Clemens 2022-08-15 13:53:16 UTC
Created attachment 139129 [details] [review]
Bug 30580: Unit test
Comment 6 Nick Clemens 2022-08-15 13:53:19 UTC
Created attachment 139130 [details] [review]
Bug 30580: Don't use GetTransfers in GetItemsAvailableToFillHoldRequestsForBib

This patch simply moves the check for transfers into the initial query

To test:
1 - Place some holds that show in the holds queue
2 - Add a manual transfer to one item
3 - Confirm it no longer hsows in the queue
4 - Apply patch
5 - Confirm item still does not appear in the queue
Comment 7 Joonas Kylmälä 2022-08-21 20:02:53 UTC
This appears to be duplicate of bug 24295. Nick, could you attach the unit test you made here to bug 24295 as it doesn't have it? A QA round would be nice as well, so we could get the patches pushed on the same go :)

*** This bug has been marked as a duplicate of bug 24295 ***