Bug 30884: Fix jQuery selector to correctly detect active tab

To reproduce:
1. Go to /tools/modborrowers.pl and fill form Card number list with data and click Continue.
2. It should give "No patron card numbers or borrowernumbers given." warning.
3. Using the browser inspector tool see that post fields cardnumberlist or borrowernumberlist
   is sent with empty data.

Apply the patch, and then:
1. Fill form Card number or Borrowernumber list and click Continue.
2. Get the result: table with patrons for editing or warning about not found number.
3. Using the inspector tool see that request has data from the active tab in the form.

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit f0062c67d6)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
This commit is contained in:
Slava Shishkin 2022-06-03 17:47:46 +03:00 committed by Lucas Gass
parent 8bcba5be88
commit 6aa9f6dd50

View file

@ -476,7 +476,7 @@
});
$("#patron_batchmod_form").on("submit", function(){
/* Reset form fields on inactive tabs */
var tab = $(this).find('.ui-tabs-active:first a').attr('href');
var tab = $(this).find('ul.nav-tabs li.active a').attr('href');
if ( tab == '#usecardnumber' ) {
$("#borrowernumberuploadfile, #patron_list_id, #borrowernumberlist").val("");
} else if ( tab == '#useborrowernumber' ) {