https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=38666

--- Comment #125 from Andrii Nugged <[email protected]> ---
Created attachment 212038
  -->
https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=212038&action=edit
Bug 38666: Gate closed stack requests with a system preference

The proposed feature always exposes its controls and applies special
rules to flagged items. Libraries need to turn it off while retaining
item flags and existing requests.

Use the effective item predicate for circulation rules and request
availability. Hide staff and OPAC controls when disabled, reject direct
queue entry before actions, and treat existing requests as ordinary
holds. Preserve stored flags, holds and printed-slip state.

Ignore the closed-stack field in staff and queued batch edits while
disabled. Apply ordinary edits normally without rewriting saved job
arguments or frozen target IDs. Existing API data and permissions remain
unchanged. False or missing preference values disable the feature;
the preference definition installs the enabled default before this code.

Test plan:
Use the existing Bug 38666 series and its workflow to prepare a closed
stack item. Rebase that series onto current main when needed.

Before applying these follow-ups:
1. Open Circulation. Closed stack requests is visible and accessible.
2. Open the item's OPAC detail page. Closed stack request is available.
3. Search for EnableClosedStackRequests. The switch is not defined.

Apply the follow-ups and run the database updater.

After applying these follow-ups:
1. Set EnableClosedStackRequests to Disable in system preferences.
2. Open Circulation. Confirm Closed stack requests is absent, while
   Holds queue and Holds to pull remain available.
3. Visit /cgi-bin/koha/circ/closed-stack-requests.pl directly.
   Confirm it returns to the Circulation home page.
4. Open the same OPAC detail page. Confirm Closed stack request is absent
   and the ordinary Place hold link remains.
5. Open an old OPAC reserve URL with closed_stack_request=1. Confirm it
   shows the ordinary Placing a hold form.
6. Set the preference to Enable. Confirm both staff and OPAC controls
   return and the same OPAC URL shows the Closed stack request form.
7. With existing requests, toggle OFF then ON and confirm stored flags,
   holds and printed-slip state survive without converting title-level
   holds into closed stack requests.

Automated tests:
prove -v t/db_dependent/ClosedStackRequests.t
Run t/cypress/integration/KohaTable/ClosedStackRequestsPreference_spec.ts.
The DB suite also covers eligibility, ordinary holds, transfers, direct
queue actions, item edit fields, and queued direct/regex batch edits.

Co-Authored-By: Loontik <[email protected]>

-- 
You are receiving this mail because:
You are watching all bug changes.
_______________________________________________
Koha-bugs mailing list -- [email protected]
To unsubscribe send an email to [email protected]
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/

Reply via email to