From f7071e91fea7fa7223d6213a85b27d3ea0e1f1fd Mon Sep 17 00:00:00 2001 From: Eric Phetteplace Date: Wed, 1 Apr 2026 11:58:12 -0700 Subject: [PATCH] Bug 42244: Fix JS TypeError on patrons ILL table The multipleSelect plugin is used on the ILL requests table but is not present when viewing a patron's ILL request history. This patch avoids a JS TypeError by checking if the plugin exists before calling it. To test: - Enable ILLModule setting - ILL Requests > New ILL Request - Metadata doesn't matter but attach to a patron account, e.g. use the "Acevedo" surname on KTD - Go to the Patron > ILL requests history - View browser's JS console, note TypeError - Apply patch - Refresh page, TypeError goes away Signed-off-by: Chris Mathevet Amended-by: Jonathan Druart Tidy Signed-off-by: Jonathan Druart Signed-off-by: Lucas Gass --- koha-tmpl/intranet-tmpl/prog/js/ill-list-table.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/koha-tmpl/intranet-tmpl/prog/js/ill-list-table.js b/koha-tmpl/intranet-tmpl/prog/js/ill-list-table.js index 16b0fdb748..5531cb009a 100644 --- a/koha-tmpl/intranet-tmpl/prog/js/ill-list-table.js +++ b/koha-tmpl/intranet-tmpl/prog/js/ill-list-table.js @@ -661,6 +661,10 @@ $(document).ready(function () { } function addStatusOptions(statuses) { + // Bug 42244: no multiselect on patron's ILL table + if (!$.fn.multipleSelect || !$("#illfilter_status").length) { + return; + } $("#illfilter_status").children().remove(); statuses .sort((a, b) => a.str.localeCompare(b.str))