[Bug 40237] New: Update reserves/request.pl to use Koha::Patron->can_place_holds
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=40237 Bug ID: 40237 Summary: Update reserves/request.pl to use Koha::Patron->can_place_holds Change sponsored?: --- Product: Koha Version: unspecified Hardware: All OS: All Status: NEW Severity: enhancement Priority: P5 - low Component: Architecture, internals, and plumbing Assignee: koha-bugs@lists.koha-community.org Reporter: martin.renvoize@openfifth.co.uk QA Contact: testopia@bugs.koha-community.org Depends on: 40101 Bug 40101 adds the new 'can_place_holds' method to Koha::Patron, but it avoided updating this complex controller and template to utilise it. Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=40101 [Bug 40101] Add `Koha::Patron->can_place_holds` -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=40237 Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |CONFIRMED -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=40237 --- Comment #1 from Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> --- Created attachment 183487 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=183487&action=edit Bug 40237: Make reserve/request.pl use $patron->can_place_holds() This patch updates the staff interface hold placement script to use the centralized patron hold validation method instead of duplicated manual validation logic. Changes: - Replaces manual maxreserves, debt, expiration, and restriction checks with $patron->can_place_holds() method call - Adds staff override support by reading override_* parameters and passing them to the validation method - Updates template to iterate through validation messages array - Enhances all "Place hold" buttons to show red "Place hold with overrides" buttons when AllowHoldPolicyOverride is enabled and validation issues exist - Maintains backward compatibility with existing item-level override functionality This consolidates patron-level hold validation logic across the codebase and provides consistent staff override capabilities in both OPAC and staff interfaces. Test plan: 1. Apply patches and restart services 2. Enable system preference AllowHoldPolicyOverride 3. Create a test patron with various restrictions: - Set expiration date in the past - Add fines exceeding maxoutstanding preference - Mark address as bad (gonenoaddress = 1) - Mark card as lost (lost = 1) - Add a debarment/restriction - Create holds to exceed maxreserves preference 4. Log into staff interface and try to place holds for this patron 5. Verify validation messages appear for each restriction 6. Verify "Place hold with overrides" red buttons appear instead of normal blue buttons 7. Click override button and verify hold is placed successfully 8. Test with single holds, multi-holds, item-level holds, and group holds 9. Disable AllowHoldPolicyOverride and verify normal restriction behavior 10. Verify existing item-level override functionality still works -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=40237 Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|CONFIRMED |Needs Signoff -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=40237 Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- Assignee|koha-bugs@lists.koha-commun |martin.renvoize@openfifth.c |ity.org |o.uk -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=40237 Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #183487|0 |1 is obsolete| | --- Comment #2 from Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> --- Created attachment 183494 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=183494&action=edit Bug 40237: Make reserve/request.pl use $patron->can_place_holds() This patch updates the staff interface hold placement script to use the centralized patron hold validation method instead of duplicated manual validation logic. Changes: - Replaces manual maxreserves, debt, expiration, and restriction checks with $patron->can_place_holds() method call - Adds staff override support by reading override_* parameters and passing them to the validation method - Updates template to iterate through validation messages array - Enhances all "Place hold" buttons to show red "Place hold with overrides" buttons when AllowHoldPolicyOverride is enabled and validation issues exist - Maintains backward compatibility with existing item-level override functionality This consolidates patron-level hold validation logic across the codebase and provides consistent staff override capabilities in both OPAC and staff interfaces. Test plan: 1. Apply patches and restart services 2. Enable system preference AllowHoldPolicyOverride 3. Create a test patron with various restrictions: - Set expiration date in the past - Add fines exceeding maxoutstanding preference - Mark address as bad (gonenoaddress = 1) - Mark card as lost (lost = 1) - Add a debarment/restriction - Create holds to exceed maxreserves preference 4. Log into staff interface and try to place holds for this patron 5. Verify validation messages appear for each restriction 6. Verify "Place hold with overrides" red buttons appear instead of normal blue buttons 7. Click override button and verify hold is placed successfully 8. Test with single holds, multi-holds, item-level holds, and group holds 9. Disable AllowHoldPolicyOverride and verify normal restriction behavior 10. Verify existing item-level override functionality still works -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=40237 Bug 40237 depends on bug 40101, which changed state. Bug 40101 Summary: Add `Koha::Patron->can_place_holds` https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=40101 What |Removed |Added ---------------------------------------------------------------------------- Status|Needs documenting |RESOLVED Resolution|--- |FIXED -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=40237 Lucas Gass (lukeg) <lucas@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Patch doesn't apply CC| |lucas@bywatersolutions.com -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=40237 Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #183494|0 |1 is obsolete| | --- Comment #3 from Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> --- Created attachment 189505 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=189505&action=edit Bug 40237: Make reserve/request.pl use $patron->can_place_holds() This patch updates the staff interface hold placement script to use the centralized patron hold validation method instead of duplicated manual validation logic. Changes: - Replaces manual maxreserves, debt, expiration, and restriction checks with $patron->can_place_holds() method call - Adds staff override support by reading override_* parameters and passing them to the validation method - Updates template to iterate through validation messages array - Enhances all "Place hold" buttons to show red "Place hold with overrides" buttons when AllowHoldPolicyOverride is enabled and validation issues exist - Maintains backward compatibility with existing item-level override functionality This consolidates patron-level hold validation logic across the codebase and provides consistent staff override capabilities in both OPAC and staff interfaces. Test plan: 1. Apply patches and restart services 2. Enable system preference AllowHoldPolicyOverride 3. Create a test patron with various restrictions: - Set expiration date in the past - Add fines exceeding maxoutstanding preference - Mark address as bad (gonenoaddress = 1) - Mark card as lost (lost = 1) - Add a debarment/restriction - Create holds to exceed maxreserves preference 4. Log into staff interface and try to place holds for this patron 5. Verify validation messages appear for each restriction 6. Verify "Place hold with overrides" red buttons appear instead of normal blue buttons 7. Click override button and verify hold is placed successfully 8. Test with single holds, multi-holds, item-level holds, and group holds 9. Disable AllowHoldPolicyOverride and verify normal restriction behavior 10. Verify existing item-level override functionality still works -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=40237 Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Patch doesn't apply |Needs Signoff -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=40237 Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- QA Contact|testopia@bugs.koha-communit |tomascohen@gmail.com |y.org | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=40237 Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |nick@bywatersolutions.com -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=40237 Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- Severity|enhancement |normal -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=40237 Tomás Cohen Arazi (tcohen) <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |tomascohen@gmail.com --- Comment #4 from Tomás Cohen Arazi (tcohen) <tomascohen@gmail.com> --- Ooof. I'm loving this patch. That's exactly what I added the `no_short_circuit` flag for. Thanks for taking care! -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=40237 --- Comment #5 from Tomás Cohen Arazi (tcohen) <tomascohen@gmail.com> --- Created attachment 189526 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=189526&action=edit Bug 40237: Make reserve/request.pl use $patron->can_place_holds() This patch updates the staff interface hold placement script to use the centralized patron hold validation method instead of duplicated manual validation logic. Changes: - Replaces manual maxreserves, debt, expiration, and restriction checks with $patron->can_place_holds() method call - Adds staff override support by reading override_* parameters and passing them to the validation method - Updates template to iterate through validation messages array - Enhances all "Place hold" buttons to show red "Place hold with overrides" buttons when AllowHoldPolicyOverride is enabled and validation issues exist - Maintains backward compatibility with existing item-level override functionality This consolidates patron-level hold validation logic across the codebase and provides consistent staff override capabilities in both OPAC and staff interfaces. Test plan: 1. Apply patches and restart services 2. Enable system preference AllowHoldPolicyOverride 3. Create a test patron with various restrictions: - Set expiration date in the past - Add fines exceeding maxoutstanding preference - Mark address as bad (gonenoaddress = 1) - Mark card as lost (lost = 1) - Add a debarment/restriction - Create holds to exceed maxreserves preference 4. Log into staff interface and try to place holds for this patron 5. Verify validation messages appear for each restriction 6. Verify "Place hold with overrides" red buttons appear instead of normal blue buttons 7. Click override button and verify hold is placed successfully 8. Test with single holds, multi-holds, item-level holds, and group holds 9. Disable AllowHoldPolicyOverride and verify normal restriction behavior 10. Verify existing item-level override functionality still works -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=40237 Tomás Cohen Arazi (tcohen) <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #189505|0 |1 is obsolete| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=40237 --- Comment #6 from Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> --- Er.. did you mean to signoff or qa here Tomas? -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=40237 David Nind <david@davidnind.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Signed Off -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=40237 David Nind <david@davidnind.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #189526|0 |1 is obsolete| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=40237 --- Comment #7 from David Nind <david@davidnind.com> --- Created attachment 192681 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=192681&action=edit Bug 40237: Make reserve/request.pl use $patron->can_place_holds() This patch updates the staff interface hold placement script to use the centralized patron hold validation method instead of duplicated manual validation logic. Changes: - Replaces manual maxreserves, debt, expiration, and restriction checks with $patron->can_place_holds() method call - Adds staff override support by reading override_* parameters and passing them to the validation method - Updates template to iterate through validation messages array - Enhances all "Place hold" buttons to show red "Place hold with overrides" buttons when AllowHoldPolicyOverride is enabled and validation issues exist - Maintains backward compatibility with existing item-level override functionality This consolidates patron-level hold validation logic across the codebase and provides consistent staff override capabilities in both OPAC and staff interfaces. Test plan: 1. Apply patches and restart services 2. Enable system preference AllowHoldPolicyOverride 3. Create a test patron with various restrictions: - Set expiration date in the past - Add fines exceeding maxoutstanding preference - Mark address as bad (gonenoaddress = 1) - Mark card as lost (lost = 1) - Add a debarment/restriction - Create holds to exceed maxreserves preference 4. Log into staff interface and try to place holds for this patron 5. Verify validation messages appear for each restriction 6. Verify "Place hold with overrides" red buttons appear instead of normal blue buttons 7. Click override button and verify hold is placed successfully 8. Test with single holds, multi-holds, item-level holds, and group holds 9. Disable AllowHoldPolicyOverride and verify normal restriction behavior 10. Verify existing item-level override functionality still works -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=40237 David Nind <david@davidnind.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |david@davidnind.com --- Comment #8 from David Nind <david@davidnind.com> --- Testing notes (using KTD): 1. Step 3, setting restrictions: - Set expiration date in the past: edit patron record and update the expiry date (Library setup > Expiry date) - Add fines exceeding maxoutstanding preference: add a manual charge for $20 (maxoutstanding is set to 5 in the default KTD) (Accounting > Create manual invoice: Type = Manual fee; Amount = 20.00)) - Mark address as bad (gonenoaddress = 1): edit patron record - Patron account flags > Address correction needed: set to Yes - Mark card as lost (lost = 1) edit patron record - Patron account flags > Lost card: set to Yes - Add a debarment/restriction: add a manual restruction - Check out > Restrictions > [Enter a comment, leave expiration date blank] > Add restriction - Create holds to exceed maxreserves preference: place four holds, then change maxreserves = 3 (instead of the default of 50) 2. Patron messages showing restrictions (I used Mary Burton, Midway as the patron): - Expiration: Patron's card has expired. Renew or Edit details - Address: Patron's address flagged as in doubt - Lost: Patron's card is flagged as lost - Account restricted since 02/07/2026 - Indefinite restriction This is a restriction (Manual restriction) - Charges: Patron has outstanding charges of 20.00. 3. Step 8, testing hold groups: - Enable DisplayAddHoldGroups system preference - Search for a term, for example: test - Select each item, then click 'Place hold' - Select a patron - On the holds detail form, select "Treat as hold group" - Set the pickup locations for selected items - Then "Place holds with overrides" 4. Step 10, I cancelled all the holds I'd already place for Mary and could place next available and item-level holds with all the restrictions in place, until maxreserves was reached -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=40237 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- Severity|normal |enhancement CC| |m.de.rooy@rijksmuseum.nl --- Comment #9 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- Moving to enh -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org