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 <chris.mathevet@inLibro.com>

Amended-by: Jonathan Druart
Tidy

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit f7071e91fe)
Signed-off-by: Jacob O'Mara <Jacob.omara@openfifth.co.uk>
This commit is contained in:
Eric Phetteplace 2026-04-01 11:58:12 -07:00 committed by Jacob O'Mara
parent 055f2d9503
commit 7d2782203e
No known key found for this signature in database
1 changed files with 4 additions and 0 deletions

View File

@ -634,6 +634,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))