Bug 35728: Add ability to NOT redirect to result when search returns only one record
authorAleisha Amohia <aleishaamohia@hotmail.com>
Mon, 8 Jan 2024 23:04:25 +0000 (23:04 +0000)
committerKatrin Fischer <katrin.fischer@bsz-bw.de>
Fri, 26 Apr 2024 16:06:06 +0000 (18:06 +0200)
commitfc8bf12e97b642900eda4056166e885e58cc4202
tree6a8fd218f2863876c9a9c2dbd8ca3193b0d50ddc
parent6d5d204d0316aebe4399c741a0e086a9f3592e72
Bug 35728: Add ability to NOT redirect to result when search returns only one record

This enhancement adds a new system preference RedirectToSoleResult. By default it is enabled, which matches current behaviour - to redirect to the detail page if it is the only search result.

To test:

1) Apply the patch, install database updates, restart services.
2) Go to Koha Administration -> Global system preferences. The RedirectToSoleResult system preference is in the Searching tab. Confirm it is enabled (set to "Redirect") by default.
3) Conduct a catalogue search on the staff interface that you know will return a single result. Confirm you are redirected to the detail page.
4) Do the same search on the OPAC. Confirm you are redirected to the detail page.
5) Go back to the system preferences and disable the RedirectToSoleResult system preference by setting it to "Don't redirect"
6) Do the searches again on the staff interface and OPAC. Confirm you are NOT redirected to the detail page, and the search results page shows as expected.

Sponsored-by: Education Services Australia SCIS
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
catalogue/search.pl
opac/opac-search.pl