Bug 30266 - Holds marked waiting with a holdingbranch that does not match can cause loss of pickup locations
Summary: Holds marked waiting with a holdingbranch that does not match can cause loss ...
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Hold requests (show other bugs)
Version: Main
Hardware: All All
: P5 - low major (vote)
Assignee: Bugs List
QA Contact: Testopia
URL:
Keywords:
Depends on:
Blocks: 30269
  Show dependency treegraph
 
Reported: 2022-03-10 12:31 UTC by Nick Clemens
Modified: 2023-12-28 20:43 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:
22.05.00,21.11.05


Attachments
Bug 30266: (3.31 KB, patch)
2022-03-10 12:39 UTC, Nick Clemens
Details | Diff | Splinter Review
Bug 30266: Hide pickup location input on waiting hold (3.38 KB, patch)
2022-03-10 19:03 UTC, Andrew Fuerste-Henry
Details | Diff | Splinter Review
Bug 30266: Hide pickup location input on waiting hold (3.49 KB, patch)
2022-03-22 12:41 UTC, Jonathan Druart
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Nick Clemens 2022-03-10 12:31:17 UTC
When a hold is waiting, but its holdingbranch does not match the expected location we don't handle this case for display or for inputs on the page. This can cause loss of data when other holds are adjusted as we resubmit all holds when updating.

We should adjust the page to only update changed holds, but for now we should handle this case and ensure necessary inputs are always present, and handle the case we have seen.


To recreate:
1 - Place two holds on a record for two different patrons, with different pickup locations
2 - Check in one item at expected branch to set waiting
3 - Then either:
    - Use batch modification or item editor to change the holding branch for the item
    - Sign in to a different branch and manually transfer the item back to it's home location
4 - View the holds for the record
5 - Note the 'Pickup library' column is blank for that hold
6 - Change pickup location for other hold and press 'Update holds'
7 - Note the waiting hold is still blank, and now second hold has no pickup location
Comment 1 Nick Clemens 2022-03-10 12:39:48 UTC
Created attachment 131553 [details] [review]
Bug 30266:

This patch updates the holds table to always insert a hidden input when a hold is 'found'
and covers the case where the hold is 'found' but doesn't match known statuses

To test:
 1 - Place two holds on a record for two different patrons, with different pickup locations
 2 - Check in one item at expected branch to set waiting
 3 - Then either:
    - Use batch modification or item editor to change the holding branch for the item
    - Sign in to a different branch and manually transfer the item back to it's home location
 4 - View the holds for the record
 5 - Note the 'Pickup library' column is blank for that hold
 6 - Change pickup location for other hold and press 'Update holds'
 7 - Note the waiting hold is still blank, and now second hold has no pickup location
 8 - Check the DB and note the first hold has had the pickup location changed
 8 - Apply patch
 9 - Delete holds and repeat 1-4
10 - Note the waiting hold now displays:
    Hold expected at {Branch}, please checkin to verify status
11 - Change location for second hold and update holds
12 - COnfirm location chanegd correctly and first hold unaffected
Comment 2 Andrew Fuerste-Henry 2022-03-10 19:03:29 UTC
Created attachment 131579 [details] [review]
Bug 30266: Hide pickup location input on waiting hold

This patch updates the holds table to always insert a hidden input when a hold is 'found'
and covers the case where the hold is 'found' but doesn't match known statuses

To test:
 1 - Place two holds on a record for two different patrons, with different pickup locations
 2 - Check in one item at expected branch to set waiting
 3 - Then either:
    - Use batch modification or item editor to change the holding branch for the item
    - Sign in to a different branch and manually transfer the item back to it's home location
 4 - View the holds for the record
 5 - Note the 'Pickup library' column is blank for that hold
 6 - Change pickup location for other hold and press 'Update holds'
 7 - Note the waiting hold is still blank, and now second hold has no pickup location
 8 - Check the DB and note the first hold has had the pickup location changed
 8 - Apply patch
 9 - Delete holds and repeat 1-4
10 - Note the waiting hold now displays:
    Hold expected at {Branch}, please checkin to verify status
11 - Change location for second hold and update holds
12 - COnfirm location chanegd correctly and first hold unaffected

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Comment 3 Andrew Fuerste-Henry 2022-03-10 19:07:33 UTC
>  3 - Then either:
>     - Use batch modification or item editor to change the holding branch for
> the item
>     - Sign in to a different branch and manually transfer the item back to
> it's home location


That second method does not work. If I try to transfer a waiting hold, Koha correctly forces me to address the hold before it will generate the transfer.
Comment 4 Jonathan Druart 2022-03-22 12:41:42 UTC
Created attachment 132017 [details] [review]
Bug 30266: Hide pickup location input on waiting hold

This patch updates the holds table to always insert a hidden input when a hold is 'found'
and covers the case where the hold is 'found' but doesn't match known statuses

To test:
 1 - Place two holds on a record for two different patrons, with different pickup locations
 2 - Check in one item at expected branch to set waiting
 3 - Then either:
    - Use batch modification or item editor to change the holding branch for the item
    - Sign in to a different branch and manually transfer the item back to it's home location
 4 - View the holds for the record
 5 - Note the 'Pickup library' column is blank for that hold
 6 - Change pickup location for other hold and press 'Update holds'
 7 - Note the waiting hold is still blank, and now second hold has no pickup location
 8 - Check the DB and note the first hold has had the pickup location changed
 8 - Apply patch
 9 - Delete holds and repeat 1-4
10 - Note the waiting hold now displays:
    Hold expected at {Branch}, please checkin to verify status
11 - Change location for second hold and update holds
12 - COnfirm location chanegd correctly and first hold unaffected

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Comment 5 Fridolin Somers 2022-03-22 20:19:46 UTC
Pushed to master for 22.05, thanks to everybody involved 🦄
Comment 6 Kyle M Hall 2022-03-25 13:44:12 UTC
Pushed to 21.11.x for 21.11.05