From 6b8f22355170df0dbb691a3f19499926aba4316a 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. Signed-off-by: Owen Leonard Signed-off-by: Paul Derscheid --- 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 4fb8c280e1..4ca325eea6 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.39.5