From ae60b15632ad76e46b3ff83221ed68eb71b7a3c0 Mon Sep 17 00:00:00 2001 From: Jan Kissig Date: Wed, 12 Jul 2023 10:40:32 +0200 Subject: [PATCH] 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 --- .../intranet-tmpl/prog/en/modules/cataloguing/addbiblio.tt | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/addbiblio.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/addbiblio.tt index c4dac925f9..7047d2d381 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/addbiblio.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/addbiblio.tt @@ -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"); -- 2.30.2