[Bug 40907] New: parenthesis and bracket are breaking filter on item table
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=40907 Bug ID: 40907 Summary: parenthesis and bracket are breaking filter on item table Change sponsored?: --- Product: Koha Version: Main Hardware: All OS: All Status: NEW Severity: enhancement Priority: P5 - low Component: Staff interface Assignee: koha-bugs@lists.koha-community.org Reporter: mathsabypro@gmail.com QA Contact: testopia@bugs.koha-community.org CC: gmcharlt@gmail.com The general filter above the item table in /catalogue/detail.pl breaks if you try to search something begining with ( or [ The "processing" popup never fades. The console displays: Uncaught SyntaxError: Invalid regular expression: /^(/i: Unterminated group (at datatables_25.0600018.js:556:47) -- 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=40907 Mathieu Saby <mathsabypro@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- 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=40907 Arthur Suzuki <arthur.suzuki@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |arthur.suzuki@biblibre.com --- Comment #1 from Arthur Suzuki <arthur.suzuki@biblibre.com> --- Actually I'm not sure this should be considered as a bug. DataTable actually support regular expression for filtering the values. For example, for a record I've set 3 items, 1 fiction, 1 non-fiction, and 1 "reference". I can have both "fiction" and "non-fiction" to appear by using this string in the search input of the table : ".*(iction)" Knowing this I'm not sure we can say parenthesis "breaks" the filter. However I was not able to properly escape the parenthesis or brackets https://www.threesl.com/blog/special-characters-regular-expressions-escape/ -- 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=40907 Arthur Suzuki <arthur.suzuki@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- See Also| |https://bugs.koha-community | |.org/bugzilla3/show_bug.cgi | |?id=40904 -- 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=40907 Jonathan Druart <jonathan.druart@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |Needs Signoff -- 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=40907 --- Comment #2 from Jonathan Druart <jonathan.druart@gmail.com> --- Created attachment 187523 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=187523&action=edit Bug 40907: Add a Cypress test -- 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=40907 --- Comment #3 from Jonathan Druart <jonathan.druart@gmail.com> --- Created attachment 187524 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=187524&action=edit Bug 40907: Prevent DT crash when searching with regex metachars We should remove the regex metacharacters from the string or JS code will raise an error and the query won't be generated, leading to the DT neverending loading problem. Test plan: Go to http://localhost:8081/cgi-bin/koha/catalogue/detail.pl?biblionumber=4 In the global "Search" of the items table, search using a regex metacharacters in order to form a broken regex (eg. '[') => Without this patch there is a JS error in the console "Uncaught SyntaxError: unterminated character class" and you get the "Processing" that never ends => With this patch applied the search succeeds. -- 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=40907 Jonathan Druart <jonathan.druart@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Assignee|koha-bugs@lists.koha-commun |jonathan.druart@gmail.com |ity.org | CC| |jonathan.druart@gmail.com -- 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=40907 --- Comment #4 from Mathieu Saby <mathsabypro@gmail.com> --- It is not known by librarian that we should use regex syntax here, so we consider the present behavior as a bug ;-) -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=40907 Biblibre Sandboxes <sandboxes@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #187524|0 |1 is obsolete| | --- Comment #5 from Biblibre Sandboxes <sandboxes@biblibre.com> --- Created attachment 187534 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=187534&action=edit Bug 40907: Prevent DT crash when searching with regex metachars We should remove the regex metacharacters from the string or JS code will raise an error and the query won't be generated, leading to the DT neverending loading problem. Test plan: Go to http://localhost:8081/cgi-bin/koha/catalogue/detail.pl?biblionumber=4 In the global "Search" of the items table, search using a regex metacharacters in order to form a broken regex (eg. '[') => Without this patch there is a JS error in the console "Uncaught SyntaxError: unterminated character class" and you get the "Processing" that never ends => With this patch applied the search succeeds. Signed-off-by: Mathieu <mathsabypro@gmail.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=40907 Biblibre Sandboxes <sandboxes@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #187523|0 |1 is obsolete| | --- Comment #6 from Biblibre Sandboxes <sandboxes@biblibre.com> --- Created attachment 187535 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=187535&action=edit Bug 40907: Add a Cypress test Signed-off-by: Mathieu <mathsabypro@gmail.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=40907 Biblibre Sandboxes <sandboxes@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #187534|0 |1 is obsolete| | --- Comment #7 from Biblibre Sandboxes <sandboxes@biblibre.com> --- Created attachment 187536 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=187536&action=edit Bug 40907: Prevent DT crash when searching with regex metachars We should remove the regex metacharacters from the string or JS code will raise an error and the query won't be generated, leading to the DT neverending loading problem. Test plan: Go to http://localhost:8081/cgi-bin/koha/catalogue/detail.pl?biblionumber=4 In the global "Search" of the items table, search using a regex metacharacters in order to form a broken regex (eg. '[') => Without this patch there is a JS error in the console "Uncaught SyntaxError: unterminated character class" and you get the "Processing" that never ends => With this patch applied the search succeeds. Signed-off-by: Mathieu <mathsabypro@gmail.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=40907 Mathieu Saby <mathsabypro@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Signed Off --- Comment #8 from Mathieu Saby <mathsabypro@gmail.com> --- Thank you Jonathan. I tested on a sandbox : no more error in the console, and I was able to find callnumber such as "[a" or "(a" -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=40907 Brendan Lawlor <blawlor@clamsnet.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #187535|0 |1 is obsolete| | --- Comment #9 from Brendan Lawlor <blawlor@clamsnet.org> --- Created attachment 187599 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=187599&action=edit Bug 40907: Add a Cypress test Signed-off-by: Mathieu <mathsabypro@gmail.com> Signed-off-by: Brendan Lawlor <blawlor@clamsnet.org> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=40907 Brendan Lawlor <blawlor@clamsnet.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #187536|0 |1 is obsolete| | --- Comment #10 from Brendan Lawlor <blawlor@clamsnet.org> --- Created attachment 187600 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=187600&action=edit Bug 40907: Prevent DT crash when searching with regex metachars We should remove the regex metacharacters from the string or JS code will raise an error and the query won't be generated, leading to the DT neverending loading problem. Test plan: Go to http://localhost:8081/cgi-bin/koha/catalogue/detail.pl?biblionumber=4 In the global "Search" of the items table, search using a regex metacharacters in order to form a broken regex (eg. '[') => Without this patch there is a JS error in the console "Uncaught SyntaxError: unterminated character class" and you get the "Processing" that never ends => With this patch applied the search succeeds. Signed-off-by: Mathieu <mathsabypro@gmail.com> Signed-off-by: Brendan Lawlor <blawlor@clamsnet.org> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=40907 Nick Clemens (kidclamp) <nick@bywatersolutions.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=40907 Nick Clemens (kidclamp) <nick@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #187599|0 |1 is obsolete| | Attachment #187600|0 |1 is obsolete| | --- Comment #11 from Nick Clemens (kidclamp) <nick@bywatersolutions.com> --- Created attachment 188022 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=188022&action=edit Bug 40907: Add a Cypress test Signed-off-by: Mathieu <mathsabypro@gmail.com> Signed-off-by: Brendan Lawlor <blawlor@clamsnet.org> Signed-off-by: Nick Clemens <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=40907 --- Comment #12 from Nick Clemens (kidclamp) <nick@bywatersolutions.com> --- Created attachment 188023 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=188023&action=edit Bug 40907: Prevent DT crash when searching with regex metachars We should remove the regex metacharacters from the string or JS code will raise an error and the query won't be generated, leading to the DT neverending loading problem. Test plan: Go to http://localhost:8081/cgi-bin/koha/catalogue/detail.pl?biblionumber=4 In the global "Search" of the items table, search using a regex metacharacters in order to form a broken regex (eg. '[') => Without this patch there is a JS error in the console "Uncaught SyntaxError: unterminated character class" and you get the "Processing" that never ends => With this patch applied the search succeeds. Signed-off-by: Mathieu <mathsabypro@gmail.com> Signed-off-by: Brendan Lawlor <blawlor@clamsnet.org> Signed-off-by: Nick Clemens <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=40907 Lucas Gass (lukeg) <lucas@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |lucas@bywatersolutions.com QA Contact|testopia@bugs.koha-communit |nick@bywatersolutions.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=40907 Lucas Gass (lukeg) <lucas@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Passed QA |Pushed to main Version(s)| |25.11.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=40907 --- Comment #13 from Lucas Gass (lukeg) <lucas@bywatersolutions.com> --- Nice work everyone! Pushed to main for 25.11 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=40907 Paul Derscheid <paul.derscheid@lmscloud.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Version(s)|25.11.00 |25.11.00,25.05.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=40907 --- Comment #14 from Paul Derscheid <paul.derscheid@lmscloud.de> --- Nice work everyone! Pushed to 25.05.x -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=40907 Fridolin Somers <fridolin.somers@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Pushed to stable |Pushed to oldstable CC| |fridolin.somers@biblibre.co | |m Version(s)|25.11.00,25.05.05 |25.11.00,25.05.05,24.11.11 released in| | --- Comment #15 from Fridolin Somers <fridolin.somers@biblibre.com> --- Pushed to 24.11.x for 24.11.11 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=40907 Wainui Witika-Park <wainuiwitikapark@catalyst.net.nz> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Pushed to oldstable |Needs documenting --- Comment #16 from Wainui Witika-Park <wainuiwitikapark@catalyst.net.nz> --- Not backporting to 22.11.x as it wasn't backported to 24.05.x -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org