Bug 41445: Fix cleanup after single hold is suspended

This fixes information displayed in the holds table for a patron after a single hold is suspended (in the "Check out" and "Details" sections for a patron record in the staff interface).

After suspending a hold, no holds are selected in the holds table, the select_hold_all checkbox is unchecked, and the holds select badge counter is 0.

Test plan:

0. Apply patch
1. Go to a patron with 2 or more active holds
2. Navigate to Details -> Holds tab
3. Click Suspend on a single hold and confirm
4. Verify the select-all checkbox remains unchecked
5. Verify the selected holds count is set to 0
6. Repeat steps 3-5 from the Check out -> Holds tab

Assisted-by: Opus 5 (Anthropic)
Sponsored-by: CLAMS
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Signed-off-by: Pedro Amorim <pedro.amorim@openfifth.co.uk>
This commit is contained in:
Lawrence O'Regan-Lloyd 2026-09-18 14:31:43 -04:00 committed by Pedro Amorim
parent 1b408f7bb2
commit c893f47bb3
No known key found for this signature in database
GPG Key ID: 06B75BA7F3894D55
1 changed files with 4 additions and 1 deletions

View File

@ -675,7 +675,10 @@ $(document).ready(function () {
$("#suspend-modal-until").flatpickr().clear(); // clean the input
}
$("#suspend-modal").modal("hide");
$(".select_hold_all").click();
$(".select_hold_all").prop("checked", false);
$(".holds_table .select_hold").prop("checked", false);
localStorage.selectedHolds = "[]";
updateSelectedHoldsButtonCounters();
});
} catch (error) {
if (error.status === 404) {