Summary: | search facets die with regex error if biblio has square brackets in fields | ||
---|---|---|---|
Product: | Koha | Reporter: | Dobrica Pavlinusic <dpavlin> |
Component: | Searching | Assignee: | Dobrica Pavlinusic <dpavlin> |
Status: | CLOSED FIXED | QA Contact: | Testopia <testopia> |
Severity: | critical | ||
Priority: | P5 - low | CC: | fridolin.somers, gmcharlt, jonathan.druart, m.de.rooy, tomascohen |
Version: | Main | ||
Hardware: | All | ||
OS: | All | ||
See Also: | http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=12151 | ||
Change sponsored?: | --- | Patch complexity: | Trivial patch |
Documentation contact: | Documentation submission: | ||
Text to go in the release notes: | Version(s) released in: | ||
Circulation function: | |||
Bug Depends on: | 12151 | ||
Bug Blocks: | |||
Attachments: |
Bug 12593 - search facets die with regex error if biblio has square brackets in fields
Bug 12593 - search facets die with regex error if biblio has square brackets in fields [PASSED QA] Bug 12593 - search facets die with regex error if biblio has square brackets in fields |
Description
Dobrica Pavlinusic
2014-07-17 10:29:29 UTC
Created attachment 29789 [details] [review] Bug 12593 - search facets die with regex error if biblio has square brackets in fields It's quite common to have [something] within facet data, and it produces following error: Unmatched [ in regex; marked by <-- HERE in m/^[ <-- HERE This problem was intoduced in Bug 12151 but is trivial to fix. I tested with an author name including [something] as well as [something So, the second case included an unmatched [ in regex, but I did not get the error (on current master). I see the [ in the facets. Could you please add some more details to reproduce this? Does it depend on specific perl version? Created attachment 29800 [details] [review] Bug 12593 - search facets die with regex error if biblio has square brackets in fields It's quite common to have [something] within facet data, and it produces following error: Unmatched [ in regex; marked by <-- HERE in m/^[ <-- HERE This problem was intoduced in Bug 12151 but is trivial to fix. Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com> Good catch. To test: - Created a bibliographic record, linked to an authority record (personal name). Did a search that returned the author as a facet. - Added a [ symbol to the author name. - Repeated the search => FAIL: "Unmatched [ in regex; marked by <-- HERE in m/^[ <-- HERE" - Apply the patch - Retry the search => SUCCESS: No error, bracket shows correctly. Passes koha-qa.pl too. (In reply to Tomás Cohen Arazi from comment #3) > To test: > - Created a bibliographic record, linked to an authority record (personal > name). Did a search that returned the author as a facet. > - Added a [ symbol to the author name. > - Repeated the search > => FAIL: "Unmatched [ in regex; marked by <-- HERE in m/^[ <-- HERE" I didn't reproduce neither. When I relaunch the search, the facet does not appear anymore in the facet list, that's all. I didn't get any error. Created attachment 29824 [details] [review] [PASSED QA] Bug 12593 - search facets die with regex error if biblio has square brackets in fields It's quite common to have [something] within facet data, and it produces following error: Unmatched [ in regex; marked by <-- HERE in m/^[ <-- HERE This problem was intoduced in Bug 12151 but is trivial to fix. Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com> Good catch. To test: - Created a bibliographic record, linked to an authority record (personal name). Did a search that returned the author as a facet. - Added a [ symbol to the author name. - Repeated the search => FAIL: "Unmatched [ in regex; marked by <-- HERE in m/^[ <-- HERE" - Apply the patch - Retry the search => SUCCESS: No error, bracket shows correctly. Passes koha-qa.pl too. Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Patch pushed to master. Thanks Dobrica! It would be good to know how reproduce this issue. (In reply to Jonathan Druart from comment #7) > It would be good to know how reproduce this issue. On comment #3 I explained the steps I used to reproduce it. (In reply to Tomás Cohen Arazi from comment #8) > (In reply to Jonathan Druart from comment #7) > > It would be good to know how reproduce this issue. > > On comment #3 I explained the steps I used to reproduce it. I have seen them, but that didn't help me. It seems working for both of you, so I suppose the patch works :) Looking at it, the changes looks consistent. (In reply to Jonathan Druart from comment #9) > (In reply to Tomás Cohen Arazi from comment #8) > > (In reply to Jonathan Druart from comment #7) > > > It would be good to know how reproduce this issue. > > > > On comment #3 I explained the steps I used to reproduce it. > > I have seen them, but that didn't help me. It seems working for both of you, > so I suppose the patch works :) > Looking at it, the changes looks consistent. I could not reproduce this problem too. Could it be a matter of some sysprefs, or perl version? In our case, we have in 440$a "[ Život i običaji ;" which is probably a mistake, but does trigger this bug. I don't think we modified any system preferences related to facets. I have Ubuntu 14.04 (amd64). This implies Perl 5.18 and Apache 2.4. For testing the patch I did:
> DROP DATABASE koha_devel;
> CREATE DATABASE koha_devel;
Run the webinstaller (mine is a DOM+MARC21 setup). Selected all the sample data. Added some sample records I have so facets are build.
Made a search,
Edited a Personal Name authority (appearing on the facets) adding '[' in the middle of the name.
Reindexed, launched the search
=> BROKEN
Pushed to 3.16.x for inclusion in 3.16.4. Bug 12151 not in 3.14.x I set as resolved |