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:
parent
850f1f224f
commit
f7071e91fe
|
|
@ -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))
|
||||
|
|
|
|||
Loading…
Reference in New Issue