From 9dba739abd377412d619799b47b0617a26087bff Mon Sep 17 00:00:00 2001 From: Lucas Gass Date: Wed, 24 Sep 2025 22:08:51 +0000 Subject: [PATCH] Bug 40565: (follow-up) Make sure there is a table_node --- koha-tmpl/intranet-tmpl/prog/js/datatables.js | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/js/datatables.js b/koha-tmpl/intranet-tmpl/prog/js/datatables.js index b20813f4d9c..0e8a12b23f5 100644 --- a/koha-tmpl/intranet-tmpl/prog/js/datatables.js +++ b/koha-tmpl/intranet-tmpl/prog/js/datatables.js @@ -1035,12 +1035,14 @@ function _dt_add_filters(table_node, table_dt, filters_options = {}) { }) .each(function () { let optionValue = this._id; - - if ( - table_dt.settings()[0].ajax !== null && - table_node.attr("id") !== "item_search" - ) { - optionValue = `^${this._id}$`; + if (table_dt.settings()[0].ajax !== null) { + let tableId = + table_node && table_node.id + ? table_node.id + : null; + if (tableId && tableId !== "item_search") { + optionValue = `^${this._id}$`; + } } let o = $( -- 2.39.5