Bug 34251: When using the fast add framework in addbiblio.pl there is thrown a JS error in selectTab( "#tab0XX_panel" );

This is because no nav tabs are build in addbiblio.tt as BIG_LOOP has a
length(size) of 1

To test:

1) go to More>Cataloging
2) click +New record
3) Click Settings> Fast add framework
4) take a look on console
5) try selecting a different framework now, will have no effect
6) apply patch and redo steps 1 to 5
7) there should be no error in console and a change in settings works a
   expected

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
This commit is contained in:
Jan Kissig 2023-07-12 10:40:32 +02:00 committed by Tomas Cohen Arazi
parent fbc21148e7
commit e3ff3a6204
Signed by: tomascohen
GPG key ID: 0A272EA1B2F3C15F

View file

@ -191,6 +191,10 @@
});
function selectTab( tablink ){
/* return if no tabs displayed (fast add framework) */
if ($(".toolbar-tabs-container .nav-tabs li").length === 0){
return;
}
let a = $("a[href='" + tablink + "']");
$(".toolbar-tabs-container .nav-tabs li").removeClass("selected");
a.tab("show").parent().addClass("selected");