From 7871426b0f1730cb51e5623e21082d3ecf597a03 Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Fri, 15 Nov 2024 14:46:28 +0100 Subject: [PATCH] Bug 38436: Do not try to build the table if tab is not there If we don't have the "other holdings" tab, no need to try to build the table. --- koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt index 4fb8c280e10..4ca325eea68 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt @@ -1965,6 +1965,10 @@ let items_tab_ids = [ 'holdings', 'otherholdings' ]; items_tab_ids.forEach( function( tab_id, index ) { + + // Early return if the tab is not shown (ie. no table) + if (!$("#%s-tab".format(tab_id)).length) return; + build_items_table(tab_id, false, {}, build_items_table_drawncallback); [% IF bundlesEnabled %] -- 2.34.1