From 74d06925e8f36d3574a6501d33ea284a11e48feb Mon Sep 17 00:00:00 2001 From: Jake Deery Date: Wed, 28 Aug 2024 12:02:50 +0100 Subject: [PATCH] Bug 37755: Fixed JavaScript for modification tabs This patch addresses a new bug which prevents correct submission on mod borrowers and mod records (mod + delete). The bug appears to have been introduced since the recent Bootstrap5 switch, and shouldn't be surfacing anywhere else in the system Note that the test plan focuses on tools/modborrowers.pl. The error also appears to exist on tools/batch_record_modification.pl and tools/batch_delete_records.pl, but is a lot harder to reproduce. Please see https://chat.koha-community.org/koha-community/pl/fmnzzgy5cpghtpdc9a9ow75scr and follow-up comments for details on reproducing this. To test: a) go to tools/modborrowers.pl and try to enter valid cardnumbers or borrowernumbers 1) notice how you cannot proceed b) APPLY PATCH c) repeat steps a 1) notice how you can now proceed d) SIGN OFF Signed-off-by: Owen Leonard Signed-off-by: Jonathan Druart Signed-off-by: Katrin Fischer --- .../intranet-tmpl/prog/en/modules/tools/batch_delete_records.tt | 2 +- .../prog/en/modules/tools/batch_record_modification.tt | 2 +- koha-tmpl/intranet-tmpl/prog/en/modules/tools/modborrowers.tt | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/batch_delete_records.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/batch_delete_records.tt index 1bc6c8c166..b75fe5d4d5 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/batch_delete_records.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/batch_delete_records.tt @@ -379,7 +379,7 @@ }); $("#record_ids_selection").on("submit", function(e){ - var tab = $(this).find('#batch_del_form:active:first a').attr('href'); + var tab = $(this).find('#batch_del_form li a.active:first').attr('href'); if ( tab == '#uploadfile_tab' ) { $("#shelf_number").empty(''); $("#recordnumber_list").val(''); diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/batch_record_modification.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/batch_record_modification.tt index 6461fac1da..62ec796fd1 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/batch_record_modification.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/batch_record_modification.tt @@ -369,7 +369,7 @@ }); $("#record_ids_selection").on("submit", function(e) { - var tab = $(this).find('#batch_mod_form li.active:first a').attr('href'); + var tab = $(this).find('#batch_mod_form li a.active:first').attr('href'); if (tab == '#uploadfile_tab_panel') { $("#recordnumber_list, #shelf_number").val(''); } else if (tab == '#shelves_tab_panel') { diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/modborrowers.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/modborrowers.tt index 08ca06942d..d26cdb8d8e 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/modborrowers.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/modborrowers.tt @@ -512,7 +512,7 @@ }); $("#patron_batchmod_form").on("submit", function(){ /* Reset form fields on inactive tabs */ - var tab = $(this).find('ul.nav-tabs li.active a').attr('href'); + var tab = $(this).find('ul.nav-tabs li a.active').attr('href'); if ( tab == '#usecardnumber_panel' ) { $("#borrowernumberuploadfile, #patron_list_id, #borrowernumberlist").val(""); } else if ( tab == '#useborrowernumber_panel' ) { -- 2.39.5