From e3ff3a62048731c130e7185f7ac81e07f41f6ff9 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 Signed-off-by: Owen Leonard Signed-off-by: Katrin Fischer Signed-off-by: Tomas Cohen Arazi --- .../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.39.5