Bug 24688

Summary: Hold priority isn't adjusted correctly if checking out a middle priority hold
Product: Koha Reporter: Aleisha Amohia <aleisha>
Component: Hold requestsAssignee: Aleisha Amohia <aleisha>
Status: CLOSED FIXED QA Contact: Testopia <testopia>
Severity: normal    
Priority: P5 - low CC: 1joynelson, emmi.takkinen, gmcharlt, kyle, lucas
Version: Main   
Hardware: All   
OS: All   
Change sponsored?: Sponsored Patch complexity: Small patch
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
20.05.00, 19.11.05, 19.05.10
Attachments: Bug 24688: Check the priority of the fulfilled hold when fixing priorities
Bug 24688: Check the priority of the fulfilled hold when fixing priorities
Bug 24688: Check the priority of the fulfilled hold when fixing priorities

Description Aleisha Amohia 2020-02-20 01:36:29 UTC
To reproduce

1. Place at least four holds on a biblio for different borrowers
2. Check out an item to the 3rd priority borrower
3. Check the existing holds table for the biblio. The priorities might be out of order, or try clicking the dropdowns and there might be an empty dropdown option, or open the browser developer tools and notice the option values in the select are missing value=3. 

So the priorities have not been adjusted to be consecutive which can cause problems
Comment 1 Aleisha Amohia 2020-02-20 01:44:18 UTC
Created attachment 99291 [details] [review]
Bug 24688: Check the priority of the fulfilled hold when fixing priorities

Currently when fixing priorities of existing holds, priorities aren't
fixed when checking out a middle priority hold because the hold has been
fulfilled and deleted. This patch adds a check for, if the hold can't be
found, an old hold with the required reserve_id.

To test:
1. Place at least four holds on a biblio for different borrowers
2. Check out an item to the 3rd priority borrower
3. Check the existing holds table for the biblio. The priorities might be
out of order, or try clicking the dropdowns and there might be an empty
dropdown option, or open the browser developer tools and notice the option
values in the select are missing value=3.
4. Apply patch and restart memcached
5. Check out an item to the 2nd priority borrower
6. Check the existing holds table for the biblio. Confirm the priorities
have been fixed and are now consecutive with no gaps.

Sponsored-by: Chartered Accountants Australia and New Zealand
Comment 2 Emmi Takkinen 2020-03-10 10:33:28 UTC
Created attachment 100435 [details] [review]
Bug 24688: Check the priority of the fulfilled hold when fixing priorities

Currently when fixing priorities of existing holds, priorities aren't
fixed when checking out a middle priority hold because the hold has been
fulfilled and deleted. This patch adds a check for, if the hold can't be
found, an old hold with the required reserve_id.

To test:
1. Place at least four holds on a biblio for different borrowers
2. Check out an item to the 3rd priority borrower
3. Check the existing holds table for the biblio. The priorities might be
out of order, or try clicking the dropdowns and there might be an empty
dropdown option, or open the browser developer tools and notice the option
values in the select are missing value=3.
4. Apply patch and restart memcached
5. Check out an item to the 2nd priority borrower
6. Check the existing holds table for the biblio. Confirm the priorities
have been fixed and are now consecutive with no gaps.

Sponsored-by: Chartered Accountants Australia and New Zealand
Signed-off-by: Emmi Takkinen <emmi.takkinen@outlook.com>
Comment 3 Kyle M Hall 2020-03-20 14:22:22 UTC
Created attachment 101117 [details] [review]
Bug 24688: Check the priority of the fulfilled hold when fixing priorities

Currently when fixing priorities of existing holds, priorities aren't
fixed when checking out a middle priority hold because the hold has been
fulfilled and deleted. This patch adds a check for, if the hold can't be
found, an old hold with the required reserve_id.

To test:
1. Place at least four holds on a biblio for different borrowers
2. Check out an item to the 3rd priority borrower
3. Check the existing holds table for the biblio. The priorities might be
out of order, or try clicking the dropdowns and there might be an empty
dropdown option, or open the browser developer tools and notice the option
values in the select are missing value=3.
4. Apply patch and restart memcached
5. Check out an item to the 2nd priority borrower
6. Check the existing holds table for the biblio. Confirm the priorities
have been fixed and are now consecutive with no gaps.

Sponsored-by: Chartered Accountants Australia and New Zealand
Signed-off-by: Emmi Takkinen <emmi.takkinen@outlook.com>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Comment 4 Martin Renvoize 2020-03-20 15:43:42 UTC
Nice work everyone!

Pushed to master for 20.05
Comment 5 Joy Nelson 2020-04-03 21:21:14 UTC
backported to 19.11.x for 19.11.05
Comment 6 Lucas Gass 2020-04-13 19:58:21 UTC
backported to 19.05.x for 19.05.10