From 30696e92aaf2b8782d1afc9f4c3ab1dbf6a917c4 Mon Sep 17 00:00:00 2001 From: Lawrence O'Regan-Lloyd Date: Fri, 30 Jan 2026 16:51:48 -0500 Subject: [PATCH] Bug 41445: Fix hold actions incorrectly toggling select-all checkbox state Replace .click() on select_hold_all with explicit .prop("checked", false) to prevent suspend, resume, cancel, and group hold actions from incorrectly checking the select-all checkbox and showing a wrong selected holds count. Test plan: 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 does not appear 6. Repeat steps 3-5 from the Check out -> Holds tab 7. Repeat using Resume, Cancel, and Group hold actions Sponsored-by: CLAMS Signed-off-by: David Nind --- koha-tmpl/intranet-tmpl/prog/js/holds.js | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/js/holds.js b/koha-tmpl/intranet-tmpl/prog/js/holds.js index 5e6537fa72..a9d4c4a0b8 100644 --- a/koha-tmpl/intranet-tmpl/prog/js/holds.js +++ b/koha-tmpl/intranet-tmpl/prog/js/holds.js @@ -126,7 +126,9 @@ $(document).ready(function () { url: "/api/v1/holds/" + encodeURIComponent(hold_id) + "/suspension", }).done(function () { if ($(".select_hold_all").prop("checked")) { - $(".select_hold_all").click(); + $(".select_hold_all").prop("checked", false); + $(".holds_table .select_hold").prop("checked", false); + updateSelectedHoldsButtonCounters(); } }); } @@ -659,7 +661,9 @@ $(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); + updateSelectedHoldsButtonCounters(); }); } catch (error) { if (error.status === 404) { @@ -1209,7 +1213,9 @@ $(document).ready(function () { .done(function () { $("#cancelModal").modal("hide"); if ($(".select_hold_all").prop("checked")) { - $(".select_hold_all").click(); + $(".select_hold_all").prop("checked", false); + $(".holds_table .select_hold").prop("checked", false); + updateSelectedHoldsButtonCounters(); } }); }); @@ -1254,7 +1260,9 @@ $(document).ready(function () { }) .done(function () { $("#group-modal").modal("hide"); - $(".select_hold_all").click(); + $(".select_hold_all").prop("checked", false); + $(".holds_table .select_hold").prop("checked", false); + updateSelectedHoldsButtonCounters(); }); } catch (error) { if (error.status === 404) { -- 2.39.5