From ec7e54f9f5db1589b6a70af30ca39e443050332c Mon Sep 17 00:00:00 2001 From: Martin Renvoize Date: Wed, 17 Dec 2025 13:38:10 +0000 Subject: [PATCH] Bug 41438: (follow-up) Fix JavaScript validation issues This follow-up patch corrects two JavaScript issues in the batch modify holds form: 1. Fixes typo: 'suspened' -> 'suspended' on line 637 This typo prevented the suspended status check from working correctly when determining if any selected holds are suspended. 2. Fixes ineffective validation logic on line 643 When a suspend date is provided without explicitly setting the suspend status, the code now properly updates the form field value instead of just setting a local variable. Changes: - Old: new_suspend_status = 1; - New: $("#new_suspend_status").val("1"); This ensures that setting a suspend date automatically sets the suspend status to "Suspend" as intended, allowing the behavior to match the server-side logic. Test plan: 1. Navigate to Tools->Batch modify holds 2. Search for and select some holds 3. Set only a "Suspend until" date without changing "Suspend holds" 4. Click "Modify holds" 5. Verify the holds are suspended with the specified date 6. Confirm the form properly auto-selects "Suspend" when a date is provided --- .../intranet-tmpl/prog/en/modules/tools/batch_modify_holds.tt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/batch_modify_holds.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/batch_modify_holds.tt index dbddd4b73f6..7248b4e56ed 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/batch_modify_holds.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/batch_modify_holds.tt @@ -634,13 +634,13 @@ var suspended = false; hold_ids.forEach(function(hold){ - if( hold.suspened ){ + if( hold.suspended ){ suspended = true; } }); if( ( !new_suspend_status || new_suspend_status == "0" || !suspended ) && new_suspend_date ){ - new_suspend_status = 1; + $("#new_suspend_status").val("1"); } if (errors.length > 0) { -- 2.52.0