Bug 24688 - Hold priority isn't adjusted correctly if checking out a middle priority hold
Summary: Hold priority isn't adjusted correctly if checking out a middle priority hold
Status: Pushed to stable
Alias: None
Product: Koha
Classification: Unclassified
Component: Hold requests (show other bugs)
Version: master
Hardware: All All
: P5 - low normal (vote)
Assignee: Aleisha Amohia
QA Contact: Testopia
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-02-20 01:36 UTC by Aleisha Amohia
Modified: 2020-04-13 19:58 UTC (History)
5 users (show)

See Also:
Change sponsored?: Sponsored
Patch complexity: Small patch
Who signed the patch off:
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 (1.67 KB, patch)
2020-02-20 01:44 UTC, Aleisha Amohia
Details | Diff | Splinter Review
Bug 24688: Check the priority of the fulfilled hold when fixing priorities (1.74 KB, patch)
2020-03-10 10:33 UTC, Emmi Takkinen
Details | Diff | Splinter Review
Bug 24688: Check the priority of the fulfilled hold when fixing priorities (1.81 KB, patch)
2020-03-20 14:22 UTC, Kyle M Hall
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
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