Bug 41335

Summary: Toggling the hold options does not always work in opac-reserve
Product: Koha Reporter: Marcel de Rooy <m.de.rooy>
Component: Hold requestsAssignee: Marcel de Rooy <m.de.rooy>
Status: Needs Signoff --- QA Contact: Testopia <testopia>
Severity: minor    
Priority: P5 - low CC: gmcharlt, lisette, tomascohen
Version: Main   
Hardware: All   
OS: All   
GIT URL: Initiative type: ---
Sponsorship status: --- Comma delimited list of Sponsors:
Crowdfunding goal: 0 Patch complexity: Small patch
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
Circulation function:
Attachments: Bug 41335: Adjust toggling hold options, preselect lone item
Bug 41335: Adjust toggling hold options, preselect lone item

Description Marcel de Rooy 2025-12-01 13:47:52 UTC
Some combinations of OPACMandatoryHoldDates together with forced item level holds make the options collapsed while they should be expanded.
Comment 1 Marcel de Rooy 2025-12-01 13:49:33 UTC
Relation with DisplayMultiItemHolds ?
Comment 2 Marcel de Rooy 2025-12-01 13:51:07 UTC
(In reply to Marcel de Rooy from comment #1)
> Relation with DisplayMultiItemHolds ?

Just another small issue: if there is only one item, we should probably preselect.
Comment 3 Marcel de Rooy 2025-12-03 14:47:00 UTC Comment hidden (obsolete)
Comment 4 Marcel de Rooy 2025-12-03 15:22:44 UTC
Created attachment 190120 [details] [review]
Bug 41335: Adjust toggling hold options, preselect lone item

By default hold options are collapsed. In the following cases they
are expanded:
- one of the hold dates is made mandatory via OPACMandatoryHoldDates
- an item level hold is forced for this biblio (at least one item is
  controlled by a circ rule where opacitemholds == F [Forced] )

When DisplayMultiItemHolds is enabled, item selection for specific items
is done via checkboxes; no item is preselected unless there is only one.
Otherwise an item is selected via radio buttons. The first one is
preselected.

Test plan:
Verify in steps 2 to 4 that the above rules are respected.
[1] Enable DisplayMultiItemHolds and OPACAllowHoldDateInFuture.
[2] Place hold on biblio with only one item where record and item level are allowed.
[3] Place hold on biblio with multiple items where item level is forced.
[4] Place hold on biblio with multiple items where item level is not forced.
[5] Toggle OPACMandatoryHoldDates (between no hold dates and another value) and repeat 2-4
[6] Disable DisplayMultiItemHolds and repeat 2-5

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Comment 5 Marcel de Rooy 2025-12-03 15:24:15 UTC
Second version counts holdable items only for preselection of checkboxes.