Summary: | (Bug 19873 follow-up) Make it possible to search on value 0 | ||
---|---|---|---|
Product: | Koha | Reporter: | Fridolin Somers <fridolin.somers> |
Component: | Searching | Assignee: | Fridolin Somers <fridolin.somers> |
Status: | CLOSED FIXED | QA Contact: | Testopia <testopia> |
Severity: | normal | ||
Priority: | P5 - low | CC: | dcook, jonathan.druart, kyle, martin.renvoize, victor |
Version: | Main | ||
Hardware: | All | ||
OS: | All | ||
See Also: | https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=28526 | ||
Change sponsored?: | --- | Patch complexity: | Trivial patch |
Documentation contact: | Documentation submission: | ||
Text to go in the release notes: | Version(s) released in: |
21.11.00,21.05.05,20.11.12
|
|
Circulation function: | |||
Bug Depends on: | 19873 | ||
Bug Blocks: | |||
Attachments: |
Bug 28365: Add unit test
Bug 28365: (Bug 19873 follow-up) Make it possible to search on value 0 Bug 28365: Add unit test Bug 28365: (Bug 19873 follow-up) Make it possible to search on value 0 |
Description
Fridolin Somers
2021-05-17 14:05:12 UTC
Created attachment 121054 [details] [review] Bug 28365: Add unit test Run prove t/db_dependent/Search.t Without fix you get error : # Failed test 'buildQuery should keep 0 value in query_cgi' # at t/db_dependent/Search.t line 670. # got: 'idx=su%2Cphr' # expected: 'idx=su%2Cphr&q=0' This patch also adds a test for query_desc in case it is broken in the future. Created attachment 121055 [details] [review] Bug 28365: (Bug 19873 follow-up) Make it possible to search on value 0 Bug 19873 fixed search with value 0. It works in first page but not in other pages. This patch fixes query_cgi var. Test plan: - create a st-numeric index in zebra conf related to a numeric field i.e: yourindex 1=yourindex 4=109 - fill a field with 0 in several biblio records, - reindex your biblios, - search yourindex=0 and go to second page of results, - should not work, - apply this patch, - test again, - should work Created attachment 127219 [details] [review] Bug 28365: Add unit test Run prove t/db_dependent/Search.t Without fix you get error : # Failed test 'buildQuery should keep 0 value in query_cgi' # at t/db_dependent/Search.t line 670. # got: 'idx=su%2Cphr' # expected: 'idx=su%2Cphr&q=0' This patch also adds a test for query_desc in case it is broken in the future. Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Created attachment 127220 [details] [review] Bug 28365: (Bug 19873 follow-up) Make it possible to search on value 0 Bug 19873 fixed search with value 0. It works in first page but not in other pages. This patch fixes query_cgi var. Test plan: - create a st-numeric index in zebra conf related to a numeric field i.e: yourindex 1=yourindex 4=109 - fill a field with 0 in several biblio records, - reindex your biblios, - search yourindex=0 and go to second page of results, - should not work, - apply this patch, - test again, - should work Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Super trivial fix, with test coverage and no regressions. Going straight for QA.. Passed. Not a big deal as the sub is private and only called once, but it would have good to test for the existence of the key, to avoid a warning. Pushed to master for 21.11, thanks to everybody involved! Pushed to 21.05.x for 21.05.05 Pushed to 20.11.x for 20.11.12 Not backported to oldoldstable (20.05.x). Feel free to ask if it's needed. |