[Bug 30183] New: ILL table search filtering broken
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30183 Bug ID: 30183 Summary: ILL table search filtering broken Change sponsored?: --- Product: Koha Version: master Hardware: All OS: All Status: NEW Severity: enhancement Priority: P5 - low Component: ILL Assignee: koha-bugs@lists.koha-community.org Reporter: andrew.isherwood@ptfs-europe.com To replicate: - View a table of ILL requests - Attempt to filter the table by typing in the search box - Note nothing happens and the console displays: Uncaught TypeError: Cannot read properties of undefined (reading '0') at Array.<anonymous> (ill-list-table_21.1101000.js:501:75) Looking at the history of ill-list-table.js there looks to be a couple of commits that have moved away from using datepicker which appear to have resulted in the breakage: https://github.com/PTFS-Europe/koha/commit/b70a9a29d77f4109b082fe6ed57cc44f3... changed the definition of illfilter_dateplaced_* variables to use Flatpickr, and: https://github.com/PTFS-Europe/koha/commit/30196fcdf3f5d726ad79c4f8983b17e9a... removed the variable definitions, which appears to be what is resulting in the error -- 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=30183 Andrew Isherwood <andrew.isherwood@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |oleonard@myacpl.org -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30183 Andrew Isherwood <andrew.isherwood@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Priority|P5 - low |P3 Severity|enhancement |normal -- 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=30183 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Keywords| |regression Depends on| |29240 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29240 [Bug 29240] Flatpickr - error in the console when a date is selected -- 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=30183 Lucy Vaux-Harvey <lucy.vaux-harvey@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |lucy.vaux-harvey@ptfs-europ | |e.com -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30183 Aude Charillon <aude.charillon@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |aude.charillon@ptfs-europe. | |com -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30183 susie.strachan@uwl.ac.uk changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |susie.strachan@uwl.ac.uk -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30183 --- Comment #1 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Created attachment 131661 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=131661&action=edit Bug 30183: Fetch flatPickr instance prior to custom search definition This patch updates teh search customisations in ill-list-table to properly fetch the existing flatpickr instances for date searches. -- 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=30183 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |martin.renvoize@ptfs-europe | |.com Assignee|koha-bugs@lists.koha-commun |martin.renvoize@ptfs-europe |ity.org |.com -- 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=30183 Martin Renvoize <martin.renvoize@ptfs-europe.com> 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=30183 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Severity|normal |major -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30183 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |tomascohen@gmail.com -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30183 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |nick@bywatersolutions.com -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30183 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |jonathan.druart+koha@gmail. | |com -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30183 Janet McGowan <janet.mcgowan@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |janet.mcgowan@ptfs-europe.c | |om -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30183 Tomás Cohen Arazi <tomascohen@gmail.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=30183 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #131661|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=30183 --- Comment #2 from Tomás Cohen Arazi <tomascohen@gmail.com> --- Created attachment 131668 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=131668&action=edit Bug 30183: Fetch flatPickr instance prior to custom search definition This patch updates teh search customisations in ill-list-table to properly fetch the existing flatpickr instances for date searches. To test: 1. Have at least one ILL request on the ILL requests page 2. Open the broser inspector 3. Choose a date on the left hand form => FAIL: Errors in the console, search doesn't work 4. Apply this patch 5. Reload 6. Repeat 2-3 => SUCCESS: No more errors, filtering works! 7. Sign off :-D Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30183 Jonathan Druart <jonathan.druart+koha@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Signed Off |Passed QA -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30183 Jonathan Druart <jonathan.druart+koha@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #131668|0 |1 is obsolete| | --- Comment #3 from Jonathan Druart <jonathan.druart+koha@gmail.com> --- Created attachment 131913 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=131913&action=edit Bug 30183: Fetch flatPickr instance prior to custom search definition This patch updates teh search customisations in ill-list-table to properly fetch the existing flatpickr instances for date searches. To test: 1. Have at least one ILL request on the ILL requests page 2. Open the broser inspector 3. Choose a date on the left hand form => FAIL: Errors in the console, search doesn't work 4. Apply this patch 5. Reload 6. Repeat 2-3 => SUCCESS: No more errors, filtering works! 7. Sign off :-D Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> 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=30183 --- Comment #4 from Jonathan Druart <jonathan.druart+koha@gmail.com> --- It works but it's awkward. I was expecting to see $(selector).val() to retrieve the formatted value, then use one of our JS function to get a Date() object. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30183 Fridolin Somers <fridolin.somers@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Version(s)| |22.05.00 released in| | Status|Passed QA |Pushed to master -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30183 --- Comment #5 from Fridolin Somers <fridolin.somers@biblibre.com> --- Pushed to master for 22.05, thanks to everybody involved 🦄 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30183 Andreas Jonsson <andreas.jonsson@kreablo.se> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |andreas.jonsson@kreablo.se --- Comment #6 from Andreas Jonsson <andreas.jonsson@kreablo.se> --- I just fixed this issue for a production system that we recently upgraded to 21.11.03 and was going to report it when I found this bug report. I think it would be nicer to avoid unnecessarily referencing the flatpickr data directly: $.fn.dataTable.ext.search.push(function(settings, data, dataIndex) { const d = (s) => s ? new Date(s) : null; const t = (value, filter, test) => { da = d(value); if (!da) { return true; } const fv = $('#illfilter_' + filter).val(); db = d(fv); if (!db) { return true; } return test(da, db); }; return t(data[14], 'dateplaced_start', (a, b) => a >= b) && t(data[14], 'dateplaced_end', (a, b) => a <= b) && t(data[16], 'datemodified_start', (a, b) => a >= b) && t(data[16], 'datemodified_end', (a, b) => a <= b); }); -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30183 Kyle M Hall <kyle@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Pushed to master |Pushed to stable CC| |kyle@bywatersolutions.com Version(s)|22.05.00 |22.05.00,21.11.05 released in| | --- Comment #7 from Kyle M Hall <kyle@bywatersolutions.com> --- Pushed to 21.11.x for 21.11.05 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30183 Jake Deery <jake.deery@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |jake.deery@ptfs-europe.com -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org