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

Signed-off-by: David Nind <david@davidnind.com>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 561535503c)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
This commit is contained in:
Jonathan Druart 2025-06-12 09:59:05 +02:00 committed by Paul Derscheid
parent 7c33240af2
commit ce72073ff5
No known key found for this signature in database
GPG Key ID: C25F9FD44CED595B
1 changed files with 1 additions and 1 deletions

View File

@ -1734,7 +1734,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 %]