Summary: | OPACNoResultsFound {QUERY_KW} placeholder doesn't always match the search terms when commas are included in the search | ||
---|---|---|---|
Product: | Koha | Reporter: | Lucas Gass (lukeg) <lucas> |
Component: | OPAC | Assignee: | Lucas Gass (lukeg) <lucas> |
Status: | CLOSED FIXED | QA Contact: | Testopia <testopia> |
Severity: | trivial | ||
Priority: | P5 - low | CC: | andrew, fridolin.somers, jonathan.druart, victor |
Version: | Main | ||
Hardware: | All | ||
OS: | All | ||
GIT URL: | Change sponsored?: | --- | |
Patch complexity: | Trivial patch | Documentation contact: | |
Documentation submission: | Text to go in the release notes: | ||
Version(s) released in: |
21.05.00,20.11.06,20.05.12
|
Circulation function: | |
Bug Depends on: | 7620 | ||
Bug Blocks: | |||
Attachments: |
Bug 28241: Fix regex to allow for content before and after comma
Bug 28241: Fix regex to allow for content before and after comma Bug 28241: Fix regex to allow for content before and after comma |
Description
Lucas Gass (lukeg)
2021-04-27 21:22:03 UTC
Created attachment 120247 [details] [review] Bug 28241: Fix regex to allow for content before and after comma 1. Set up the OPACNoResultsFound with the {QUERY_KW} placeholder. 2.Do a search with a comma that will return no results. Like "King, Martin Luther". If the returns results add some additional characters to the search until no results are returns. 3. Look at the #noresultsfound HTML element. Anything before (or after) the comma is omitted. So the placeholder looks something like 'Martin Luther' instead of 'King, Martin Luther'. 4. Apply patch 5. Try the search again, you should see the content before and after a comma (In reply to Lucas Gass from comment #1) > 5. Try the search again, you should see the content before and after a comma Instead of "searchterm1,searchterm2" I see "searchterm1+searchterm2" Is that to be expected? Created attachment 120319 [details] [review] Bug 28241: Fix regex to allow for content before and after comma 1. Set up the OPACNoResultsFound with the {QUERY_KW} placeholder. 2.Do a search with a comma that will return no results. Like "King, Martin Luther". If the returns results add some additional characters to the search until no results are returns. 3. Look at the #noresultsfound HTML element. Anything before (or after) the comma is omitted. So the placeholder looks something like 'Martin Luther' instead of 'King, Martin Luther'. 4. Apply patch 5. Try the search again, you should see the content before and after a comma Signed-off-by: Lisette Scheer <lisettes@latahlibrary.org> I've got an example subject of: 600_aKing, Martin Luther, _cJr., _d1929-1968 _vJuvenile literature. Without the patch, I get: (Martin+AND+Juvenile+literature+AND+Jr+AND+1929-1968) With the patch I get: (King+Martin+Luther+AND+Juvenile+literature+AND+Jr+AND+1929-1968) That looks correct to me. On second thought, "consistent" would be a better word than "correct." I wouldn't have any complaint about ditching the + signs and putting in commas and spaces, but this patch hasn't made a change there. Created attachment 120712 [details] [review] Bug 28241: Fix regex to allow for content before and after comma 1. Set up the OPACNoResultsFound with the {QUERY_KW} placeholder. 2.Do a search with a comma that will return no results. Like "King, Martin Luther". If the returns results add some additional characters to the search until no results are returns. 3. Look at the #noresultsfound HTML element. Anything before (or after) the comma is omitted. So the placeholder looks something like 'Martin Luther' instead of 'King, Martin Luther'. 4. Apply patch 5. Try the search again, you should see the content before and after a comma Signed-off-by: Lisette Scheer <lisettes@latahlibrary.org> Signed-off-by: Nick Clemens <nick@bywatersolutions.com> Pushed to master for 21.05, thanks to everybody involved! Pushed to 20.11.x for 20.11.06 Pushed to 20.05.x for 20.05.12 Not backported to oldoldstable (19.11.x). Feel free to ask if it's needed. |