Bug 38412 - Koha should warn when hold on bibliographic record requires hold policy override
Summary: Koha should warn when hold on bibliographic record requires hold policy override
Status: Signed Off
Alias: None
Product: Koha
Classification: Unclassified
Component: Hold requests (show other bugs)
Version: Main
Hardware: All All
: P5 - low normal
Assignee: Thibaud Guillot (thibaud_g)
QA Contact: Testopia
URL:
Keywords:
Depends on: 35573
Blocks:
  Show dependency treegraph
 
Reported: 2024-11-08 18:18 UTC by Andrew Fuerste-Henry
Modified: 2025-05-23 12:42 UTC (History)
4 users (show)

See Also:
GIT URL:
Change sponsored?: ---
Patch complexity: ---
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:
Circulation function:


Attachments
Bug 38412: Display warning on biblio level (1.94 KB, patch)
2025-05-14 14:10 UTC, Thibaud Guillot (thibaud_g)
Details | Diff | Splinter Review
Bug 38412: Display warning on biblio level (2.00 KB, patch)
2025-05-23 12:41 UTC, Andrew Fuerste-Henry
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Andrew Fuerste-Henry 2024-11-08 18:18:03 UTC
When AllowHoldPolicyOverride is set to Allow, Koha will specifically mark items for which an item-level hold will require an override. However, nothing in the interface indicates when the bibliographic level hold will require an override. 

To recreate:
 - Have AllowHoldPolicyOverride set to Don't Allow
 - Have a bib record with just one item
 - confirm you can place a hold on either the biblio or the item
 - edit your item such that it become unholdable (mark it Not For Loan or something)
 - confirm that you cannot place a hold on either the biblio or the item
 - set AllowHoldPolicyOverride to Allow
 - confirm that Koha shows an alert on the item indicating that the hold will require an override
 - confirm that Koha does not indicate the bibliographic level hold will require an override

Bug 33573 restored these alerts for items. I don't recall if we've ever had these alerts for biblios.
Comment 1 Thibaud Guillot (thibaud_g) 2025-05-14 14:10:45 UTC
Created attachment 182450 [details] [review]
Bug 38412: Display warning on biblio level

When no element is available, with AllowHoldPolicyOverride, a triangle appears on each element to be forced, but if you choose “next item available” without having any item available, you won't see anything.
I think there's a small correction to be made in request.pl because there's no incrementation of $num_override when the item is to be forced...

So I added it and logic did the rest.

Test plan:
1) Set circulations rules for specific category and/or itemtype (for example 0 hold allowed for staff on books). Set AllowHoldPolicyOverride on "Allow".
2) For testing go on biblio with books itemtype, and place a hold for a staff category patron
3) Normally you will see triangles on each item on specific section but you can force it. When you just select the next item available none triangle and none alert showing.
4) Apply this patch and restart_all
5) Refresh your browser page
6) Normally now there is a triangle into 'Place hold' submit button and an alert pops up after click on it.

Sponsored by: BibLibre
Comment 2 David Nind 2025-05-22 22:57:32 UTC
Added assignee.
Comment 3 Andrew Fuerste-Henry 2025-05-23 12:41:11 UTC
Created attachment 182767 [details] [review]
Bug 38412: Display warning on biblio level

When no element is available, with AllowHoldPolicyOverride, a triangle appears on each element to be forced, but if you choose “next item available” without having any item available, you won't see anything.
I think there's a small correction to be made in request.pl because there's no incrementation of $num_override when the item is to be forced...

So I added it and logic did the rest.

Test plan:
1) Set circulations rules for specific category and/or itemtype (for example 0 hold allowed for staff on books). Set AllowHoldPolicyOverride on "Allow".
2) For testing go on biblio with books itemtype, and place a hold for a staff category patron
3) Normally you will see triangles on each item on specific section but you can force it. When you just select the next item available none triangle and none alert showing.
4) Apply this patch and restart_all
5) Refresh your browser page
6) Normally now there is a triangle into 'Place hold' submit button and an alert pops up after click on it.

Sponsored by: BibLibre

Signed-off-by: Andrew Fuerste Henry <andrew@bywatersolutions.com>
Comment 4 Andrew Fuerste-Henry 2025-05-23 12:42:48 UTC
The new little triangle alert icon might be more visible if it were next to the button rather than within it, since it's a yellow icon and an orange button. But that's a minor quibble with a nice improvement. thanks!