[Bug 10131] New: System preference search doesn't work for search terms starting with *
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=10131 Bug ID: 10131 Summary: System preference search doesn't work for search terms starting with * Classification: Unclassified Change sponsored?: --- Product: Koha Version: master Hardware: All OS: All Status: NEW Severity: trivial Priority: P5 - low Component: System Administration Assignee: koha-bugs@lists.koha-community.org Reporter: katrin.fischer@bsz-bw.de CC: gmcharlt@gmail.com If you try searching for a system preference with something like *black* you will get an ugly error message: Software error: Quantifier follows nothing in regex; marked by <-- HERE in m/* <-- HERE notes/ at /usr/share/koha/intranet/cgi-bin/admin/preferences.pl line 255. -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=10131 Jonathan Druart <jonathan.druart@biblibre.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.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=10131 --- Comment #1 from Jonathan Druart <jonathan.druart@biblibre.com> --- Created attachment 37818 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=37818&action=edit Bug 10131: Add a fallback if the pref search is not a valid regex It's possible to search prefs using a regex. But it the regex is not correctly written, the app explodes. We should provide a fallback. Test plan: 0/ Does not apply the patch 1/ Search for sysprefs with "notes.*", note the number of results 2/ Search for *notes*, boom 3/ Apply the patch 4/ Repeat 1 and confirm you get the same number of results 5/ Repeat 2 and confirm you don't get the error anymore -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=10131 M. Tompsett <mtompset@hotmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |mtompset@hotmail.com --- Comment #2 from M. Tompsett <mtompset@hotmail.com> --- (In reply to Jonathan Druart from comment #1)
1/ Search for sysprefs with "notes.*", note the number of results 2/ Search for *notes*, boom 3/ Apply the patch 4/ Repeat 1 and confirm you get the same number of results 5/ Repeat 2 and confirm you don't get the error anymore
Actually, I've tried: black -- works (1 result) black.* -- works (1 result) .*black -- works (1 result) .*black.* -- works (1 result) black* -- works (1 result) *black -- runs (0 results) *black* -- runs (0 results) Perl 5.18.2 on Ubuntu 14.04 if that matters. Why the two with 0 results? -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=10131 M. Tompsett <mtompset@hotmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Assignee|koha-bugs@lists.koha-commun |jonathan.druart@biblibre.co |ity.org |m --- Comment #3 from M. Tompsett <mtompset@hotmail.com> --- Since bugzilla didn't tell me that Jonathan got my question, and since he provided the patch, I changed the bug so he is the assigned person. -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=10131 --- Comment #4 from Jonathan Druart <jonathan.druart@biblibre.com> --- (In reply to M. Tompsett from comment #2)
(In reply to Jonathan Druart from comment #1)
1/ Search for sysprefs with "notes.*", note the number of results 2/ Search for *notes*, boom 3/ Apply the patch 4/ Repeat 1 and confirm you get the same number of results 5/ Repeat 2 and confirm you don't get the error anymore
Actually, I've tried: black -- works (1 result) black.* -- works (1 result) .*black -- works (1 result) .*black.* -- works (1 result) black* -- works (1 result) *black -- runs (0 results) *black* -- runs (0 results)
Perl 5.18.2 on Ubuntu 14.04 if that matters. Why the two with 0 results?
Because it's not a well formatted regex. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=10131 M. Tompsett <mtompset@hotmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Signed Off -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=10131 M. Tompsett <mtompset@hotmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #37818|0 |1 is obsolete| | --- Comment #5 from M. Tompsett <mtompset@hotmail.com> --- Created attachment 37825 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=37825&action=edit Bug 10131: Add a fallback if the pref search is not a valid regex It's possible to search prefs using a regex. But it the regex is not correctly written, the app explodes. We should provide a fallback. Test plan: 0/ Does not apply the patch 1/ Search for sysprefs with "notes.*", note the number of results 2/ Search for *notes*, boom 3/ Apply the patch 4/ Repeat 1 and confirm you get the same number of results 5/ Repeat 2 and confirm you don't get the error anymore NOTE: As noted on comment #3, the kaboom is because of the leading * and not the following *, because 's*' is a valid regular expression, while '*n' is not. Signed-off-by: Mark Tompsett <mtompset@hotmail.com> -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=10131 M. Tompsett <mtompset@hotmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #37825|0 |1 is obsolete| | --- Comment #6 from M. Tompsett <mtompset@hotmail.com> --- Created attachment 37826 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=37826&action=edit Bug 10131: Add a fallback if the pref search is not a valid regex It's possible to search prefs using a regex. But it the regex is not correctly written, the app explodes. We should provide a fallback. Test plan: 0/ Does not apply the patch 1/ Search for sysprefs with "notes.*", note the number of results 2/ Search for *notes*, boom 3/ Apply the patch 4/ Repeat 1 and confirm you get the same number of results 5/ Repeat 2 and confirm you don't get the error anymore NOTE: As noted on comment #4, the kaboom is because of the leading * and not the following *, because 's*' is a valid regular expression, while '*n' is not. Signed-off-by: Mark Tompsett <mtompset@hotmail.com> -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=10131 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Signed Off |Passed QA Patch complexity|--- |Small patch -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=10131 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #37826|0 |1 is obsolete| | --- Comment #7 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- Created attachment 37920 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=37920&action=edit [PASSED QA] Bug 10131: Add a fallback if the pref search is not a valid regex It's possible to search prefs using a regex. But it the regex is not correctly written, the app explodes. We should provide a fallback. Test plan: 0/ Does not apply the patch 1/ Search for sysprefs with "notes.*", note the number of results 2/ Search for *notes*, boom 3/ Apply the patch 4/ Repeat 1 and confirm you get the same number of results 5/ Repeat 2 and confirm you don't get the error anymore NOTE: As noted on comment #4, the kaboom is because of the leading * and not the following *, because 's*' is a valid regular expression, while '*n' is not. Signed-off-by: Mark Tompsett <mtompset@hotmail.com> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=10131 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |tomascohen@gmail.com Status|Passed QA |Pushed to Master --- Comment #8 from Tomás Cohen Arazi <tomascohen@gmail.com> --- Patch pushed to master. Thanks Jonathan! -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=10131 Chris Cormack <chris@bigballofwax.co.nz> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Pushed to Master |Pushed to Stable CC| |chris@bigballofwax.co.nz --- Comment #9 from Chris Cormack <chris@bigballofwax.co.nz> --- Pushed to 3.18.x will be in 3.18.6 -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org