[Bug 42244] New: Fix JS TypeError on patrons ILL table
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42244 Bug ID: 42244 Summary: Fix JS TypeError on patrons ILL table Initiative type: --- Sponsorship --- status: Product: Koha Version: Main Hardware: All OS: All Status: NEW Severity: enhancement Priority: P5 - low Component: ILL Assignee: koha-bugs@lists.koha-community.org Reporter: ephetteplace@cca.edu QA Contact: testopia@bugs.koha-community.org CC: lisette@bywatersolutions.com, pedro.amorim@openfifth.co.uk, tomascohen@gmail.com See this comment from Bug 30200 - https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30200#c53 ill-list-table.js assumes that the multipleSelect jQuery plugin has been loaded, but it is not present when viewing the ILL table via a patron's record at /cgi-bin/koha/members/ill-requests.pl?borrowernumber=1234 . There is no need for multipleSelect since it is used in the left-side Status filter on the ILL Requests tab, which is not present on the member's ILL request page. I will write a patch that does a simple check for the multipleSelect plugin before running the code in addStatusOptions(). -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42244 Eric Phetteplace <ephetteplace@cca.edu> changed: What |Removed |Added ---------------------------------------------------------------------------- Severity|enhancement |trivial Depends on| |30200 Patch complexity|--- |Trivial patch Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30200 [Bug 30200] Add customizable tabs to interlibrary loan requests list -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42244 Eric Phetteplace <ephetteplace@cca.edu> changed: What |Removed |Added ---------------------------------------------------------------------------- Assignee|koha-bugs@lists.koha-commun |ephetteplace@cca.edu |ity.org | -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42244 --- Comment #1 from Eric Phetteplace <ephetteplace@cca.edu> --- Created attachment 196629 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=196629&action=edit 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 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42244 Eric Phetteplace <ephetteplace@cca.edu> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |Needs Signoff -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42244 OpenFifth Sandboxes <sandboxes@openfifth.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #196629|0 |1 is obsolete| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42244 --- Comment #2 from OpenFifth Sandboxes <sandboxes@openfifth.co.uk> --- Created attachment 196642 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=196642&action=edit 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: Aude Charillon <aude.charillon@openfifth.co.uk> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42244 Aude Charillon <aude.charillon@openfifth.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |aude.charillon@openfifth.co | |.uk Status|Needs Signoff |Signed Off --- Comment #3 from Aude Charillon <aude.charillon@openfifth.co.uk> --- Followed the test plan; works as described. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42244 Jonathan Druart <jonathan.druart@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |jonathan.druart@gmail.com --- Comment #4 from Jonathan Druart <jonathan.druart@gmail.com> --- Why do yo test `$.fn.multipleSelect` and not `$("#illfilter_status").length`? -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42244 Jonathan Druart <jonathan.druart@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Signed Off |In Discussion --- Comment #5 from Jonathan Druart <jonathan.druart@gmail.com> --- (In reply to Jonathan Druart from comment #4)
Why do yo test `$.fn.multipleSelect` and not `$("#illfilter_status").length`?
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 16b0fdb7481..c2e4393c961 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,7 @@ $(document).ready(function () { } function addStatusOptions(statuses) { + if (!$("#illfilter_status").length){return} $("#illfilter_status").children().remove(); statuses .sort((a, b) => a.str.localeCompare(b.str)) -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42244 --- Comment #6 from Eric Phetteplace <ephetteplace@cca.edu> --- My logic was that the type error is due to the missing jQuery plugin, not the missing element. Theoretically, if the ILL list is embedded somewhere else which has an #illfilter_status element but not the multiselect plugin, the type error would recur. Why not check for both? if ($.fn.multipleSelect && $("#illfilter_status") { // function body } -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42244 --- Comment #7 from Eric Phetteplace <ephetteplace@cca.edu> --- Since there hasn't been further discussion, I will make my change suggested above and set this back to Needs Signoff. I will follow Jonathan's `if...return` style so the patch is smaller and doesn't change the indentation of the whole function. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42244 Eric Phetteplace <ephetteplace@cca.edu> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #196642|0 |1 is obsolete| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42244 --- Comment #8 from Eric Phetteplace <ephetteplace@cca.edu> --- Created attachment 198474 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=198474&action=edit 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 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42244 Eric Phetteplace <ephetteplace@cca.edu> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|In Discussion |Needs Signoff -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42244 Chris Mathevet <chris.mathevet@inLibro.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Signed Off -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42244 Chris Mathevet <chris.mathevet@inLibro.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #198474|0 |1 is obsolete| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42244 --- Comment #9 from Chris Mathevet <chris.mathevet@inLibro.com> --- Created attachment 198686 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=198686&action=edit 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> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42244 Jonathan Druart <jonathan.druart@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Signed Off |Passed QA QA Contact|testopia@bugs.koha-communit |jonathan.druart@gmail.com |y.org | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42244 Jonathan Druart <jonathan.druart@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #198686|0 |1 is obsolete| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42244 --- Comment #10 from Jonathan Druart <jonathan.druart@gmail.com> --- Created attachment 198725 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=198725&action=edit 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> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42244 Lucas Gass (lukeg) <lucas@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Passed QA |Pushed to main Version(s)| |26.05.00 released in| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42244 --- Comment #11 from Lucas Gass (lukeg) <lucas@bywatersolutions.com> --- Nice work everyone! Pushed to main for 26.05 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42244 Jacob O'Mara <jacob.omara@openfifth.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- Version(s)|26.05.00 |26.05.00,25.11.05 released in| | Status|Pushed to main |Pushed to stable -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42244 --- Comment #12 from Jacob O'Mara <jacob.omara@openfifth.co.uk> --- Thanks all, pushed to 25.11.x -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42244 Bug 42244 depends on bug 30200, which changed state. Bug 30200 Summary: Add customizable tabs to interlibrary loan requests list https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30200 What |Removed |Added ---------------------------------------------------------------------------- Status|Needs documenting |RESOLVED Resolution|--- |FIXED -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42244 Wainui Witika-Park <wainuiwitikapark@catalyst.net.nz> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Pushed to stable |Needs documenting CC| |wainuiwitikapark@catalyst.n | |et.nz --- Comment #13 from Wainui Witika-Park <wainuiwitikapark@catalyst.net.nz> --- Not backporting to 25.05 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42244 Aude Charillon <aude.charillon@openfifth.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- Resolution|--- |FIXED Status|Needs documenting |RESOLVED --- Comment #14 from Aude Charillon <aude.charillon@openfifth.co.uk> --- No need for any update to the Koha Manual. -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org