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>
This commit is contained in:
Eric Phetteplace 2026-04-01 11:58:12 -07:00 committed by Lucas Gass
parent 850f1f224f
commit f7071e91fe
No known key found for this signature in database
GPG Key ID: 60B447398B0D36CA
1 changed files with 4 additions and 0 deletions

View File

@ -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))