Bug 38412

Summary: Koha should warn when hold on bibliographic record requires hold policy override
Product: Koha Reporter: Andrew Fuerste-Henry <andrew>
Component: Hold requestsAssignee: Thibaud Guillot (thibaud_g) <thibaud.guillot>
Status: Signed Off --- QA Contact: Testopia <testopia>
Severity: normal    
Priority: P5 - low CC: david, gmcharlt, lucas, mteal
Version: Main   
Hardware: All   
OS: All   
GIT URL: Change sponsored?: ---
Patch complexity: --- Documentation contact:
Documentation submission: Text to go in the release notes:
Version(s) released in:
Circulation function:
Bug Depends on: 35573    
Bug Blocks:    
Attachments: Bug 38412: Display warning on biblio level
Bug 38412: Display warning on biblio level

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!