Bug 19873 fixed search with value 0. It works in first page but not in other pages.
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.