From 640a3b806303ae842b2e4438565b5387b3b037c4 Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Thu, 12 Jun 2025 09:59:05 +0200 Subject: [PATCH] Bug 40127: Remove JS error from the biblio detail page when no items "build_items_table is not defined" We should not try to build the items table if there are no items. Test plan: Go to the bibliographic detail page of a biblio without items You should not see errors in the browser's console Go to the bibliographic detail page of a biblio with items You should not see errors in the browser's console The table should be displayed and the different features should work as before --- koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 398b41d0f2a..f56c645ba10 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt @@ -1732,7 +1732,7 @@ 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; + if (!$("#%s_table".format(tab_id)).length) return; [% IF Koha.Preference('AlwaysShowHoldingsTableFilters') %] build_items_table(tab_id, true, {}, build_items_table_drawncallback); [% ELSE %] -- 2.34.1