From 394d3ef3569a0a732c7d9d43f527e7797cb6051b Mon Sep 17 00:00:00 2001 From: Owen Leonard Date: Thu, 23 Mar 2023 17:15:48 +0000 Subject: [PATCH] Bug 33322: Refine click handler for suggestion batch operations The handler for suggestion batch operations looks for clicks on "button[type='submit']" which is not very specific. With the new staff interface this ends up including the header search form. This patch modifies the markup of the batch operations section of the template and makes the click handler more specific so that only the right buttons are affected. To test, apply the patch and go to Suggestions. - In the header search form, perform a catalog search. You should be able to click the submit button to successfully initiate the search. - Without checking a checkbox associated with any open suggestion, test the batch operation buttons at the bottom: - Change status - Change item type - Update manager - Delete - Archive All should trigger a JS alert, "Please select at least one suggestion" - Test each batch operation with one or more suggestions selected and confirm that the operation completes successfully. Signed-off-by: Laura Escamilla Signed-off-by: Nick Clemens Signed-off-by: Tomas Cohen Arazi (cherry picked from commit 2f1dffe1d5bbbb3deb6c92d881e2a8025ee8b672) Signed-off-by: Jacob O'Mara --- .../intranet-tmpl/prog/en/modules/suggestion/suggestion.tt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/suggestion/suggestion.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/suggestion/suggestion.tt index 93d6cac8e7..6f72d2a97b 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/suggestion/suggestion.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/suggestion/suggestion.tt @@ -888,7 +888,7 @@

Change selected suggestions

-
+
@@ -1412,7 +1412,7 @@ $("#" + target).toggle(); }); - $("button[type='submit']").on("click", function(e) { + $("button[type='submit']", "#suggestions_batch_ops").on("click", function(e) { var submit_button = this; var form = $(submit_button).parents("form"); var action = $(submit_button).val(); -- 2.39.5