Bug 24485 - AllowHoldPolicyOverride should allow Staff to override the Holds Per Record Rule
Summary: AllowHoldPolicyOverride should allow Staff to override the Holds Per Record Rule
Status: Pushed to oldstable
Alias: None
Product: Koha
Classification: Unclassified
Component: Hold requests (show other bugs)
Version: master
Hardware: All All
: P5 - low major (vote)
Assignee: Nick Clemens
QA Contact: Testopia
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-01-22 15:53 UTC by Kelly McElligott
Modified: 2020-02-10 16:38 UTC (History)
7 users (show)

See Also:
Change sponsored?: ---
Patch complexity: Trivial patch
Who signed the patch off:
Text to go in the release notes:
Version(s) released in:
20.05.00, 19.11.03, 19.05.08


Attachments
Bug 24485: Allow hold when some can be overridden (2.42 KB, patch)
2020-01-28 14:01 UTC, Nick Clemens
Details | Diff | Splinter Review
Bug 24485: Allow hold when some can be overridden (2.48 KB, patch)
2020-01-28 15:37 UTC, ByWater Sandboxes
Details | Diff | Splinter Review
Bug 24485: Allow hold when some can be overridden (2.55 KB, patch)
2020-02-04 14:17 UTC, Martin Renvoize
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Kelly McElligott 2020-01-22 15:53:05 UTC
Prior to 19.05, if a library had the system preference, AllowHoldPolicyOverride, set to Allow, a staff member could place more than one item specific hold on a record although the circulation rule for "Holds per Record" was set to 1.  Currently, in 19.05.06, the ability to override such a hold has been removed.  The process stops at the portion where the second item level hold is about to be placed, however, the Place Hold (at the bottom) button is Greyed out.  This means Koha is allowing the staff member to choose the item and then not letting the process to complete.

A library with the system preference set to ALLOW for AllowHoldPolicyOverride should be allowed to override a hold rule.
Comment 1 Kelly McElligott 2020-01-24 16:11:35 UTC
A broader issue to this bug seems to also stem from the system preference "maxreserves". 

In the example below, AllowHoldPolicyOverride is set to Allow, a staff member should be able to override the Holds per Record value and also the MaxReserves system preference, however, Koha is again stopping the override from happening if it hits this system preference MaxREserves.

1. AllowHoldPolicyOverride- set to Allow
2. Circulation Rule - 500 Holds Per Record allowed 
3. MaxReserve system preference set to 5.
4. Patron has 6 holds - 1 of those holds is on 1 item of a bib record.
5. Staff can not place a second item level hold on a record due to this sys pref MaxReserve value.
Comment 2 Nick Clemens 2020-01-28 14:01:59 UTC
Created attachment 98032 [details] [review]
Bug 24485: Allow hold when some can be overridden

The check to see if we can place a hold counts the number that we can override vs the number of items on the record.

We cannot override if we already have a hold on an item, however, we don't count these to see if they plus
the number of overrides equal the items on the record.

To test:
1 - Set max reserves to 2, allow 2 holds per recrod
2 - Place 2 holds for a patron on some records
3 - Find another record with 2 items
4 - Place a hold on the first item, you will be notified about the limit but you can override
5 - Attempt to place hold on second item, cannot be done, button disabled
6 - Apply patch
7 - Repeat
8 - You can place the second hold
Comment 3 ByWater Sandboxes 2020-01-28 15:37:02 UTC
Created attachment 98038 [details] [review]
Bug 24485: Allow hold when some can be overridden

The check to see if we can place a hold counts the number that we can override vs the number of items on the record.

We cannot override if we already have a hold on an item, however, we don't count these to see if they plus
the number of overrides equal the items on the record.

To test:
1 - Set max reserves to 2, allow 2 holds per recrod
2 - Place 2 holds for a patron on some records
3 - Find another record with 2 items
4 - Place a hold on the first item, you will be notified about the limit but you can override
5 - Attempt to place hold on second item, cannot be done, button disabled
6 - Apply patch
7 - Repeat
8 - You can place the second hold

Signed-off-by: Kelly McElligott <kelly@bywatersolutions.com>
Comment 4 Martin Renvoize 2020-02-04 14:17:51 UTC
Created attachment 98394 [details] [review]
Bug 24485: Allow hold when some can be overridden

The check to see if we can place a hold counts the number that we can override vs the number of items on the record.

We cannot override if we already have a hold on an item, however, we don't count these to see if they plus
the number of overrides equal the items on the record.

To test:
1 - Set max reserves to 2, allow 2 holds per recrod
2 - Place 2 holds for a patron on some records
3 - Find another record with 2 items
4 - Place a hold on the first item, you will be notified about the limit but you can override
5 - Attempt to place hold on second item, cannot be done, button disabled
6 - Apply patch
7 - Repeat
8 - You can place the second hold

Signed-off-by: Kelly McElligott <kelly@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Comment 5 Martin Renvoize 2020-02-04 14:18:35 UTC
Code scans well and does whats expected.. simple improvement and passes qa scripts.. Passing QA
Comment 6 Martin Renvoize 2020-02-05 12:39:05 UTC
Nice work everyone!

Pushed to master for 20.05
Comment 7 Joy Nelson 2020-02-06 20:27:10 UTC
Pushed to 19.11.x branch for 19.11.03
Comment 8 Lucas Gass 2020-02-10 16:38:02 UTC
backported to 19.05.x for 19.05.08