Bug 35728 - Add option to NOT redirect to result when search returns only one record
Summary: Add option to NOT redirect to result when search returns only one record
Status: Passed QA
Alias: None
Product: Koha
Classification: Unclassified
Component: Searching (show other bugs)
Version: Main
Hardware: All All
: P5 - low enhancement (vote)
Assignee: Aleisha Amohia
QA Contact: Nick Clemens
URL:
Keywords:
: 25885 (view as bug list)
Depends on:
Blocks:
 
Reported: 2024-01-08 22:47 UTC by Aleisha Amohia
Modified: 2024-04-01 17:16 UTC (History)
6 users (show)

See Also:
Change sponsored?: Sponsored
Patch complexity: Small patch
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:


Attachments
Bug 35728: Add ability to NOT redirect to result when search returns only one record (4.76 KB, patch)
2024-01-08 23:13 UTC, Aleisha Amohia
Details | Diff | Splinter Review
Bug 35728: Add RedirectToSoleResult system preference (4.02 KB, patch)
2024-01-09 19:47 UTC, Aleisha Amohia
Details | Diff | Splinter Review
Bug 35728: Add ability to NOT redirect to result when search returns only one record (4.76 KB, patch)
2024-01-09 19:47 UTC, Aleisha Amohia
Details | Diff | Splinter Review
Bug 35728: Add RedirectToSoleResult system preference (4.06 KB, patch)
2024-01-09 20:22 UTC, David Nind
Details | Diff | Splinter Review
Bug 35728: Add ability to NOT redirect to result when search returns only one record (4.81 KB, patch)
2024-01-09 20:22 UTC, David Nind
Details | Diff | Splinter Review
Bug 35728: Add RedirectToSoleResult system preference (4.03 KB, patch)
2024-04-01 17:16 UTC, Nick Clemens
Details | Diff | Splinter Review
Bug 35728: Add ability to NOT redirect to result when search returns only one record (4.86 KB, patch)
2024-04-01 17:16 UTC, Nick Clemens
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Aleisha Amohia 2024-01-08 22:47:46 UTC

    
Comment 1 Aleisha Amohia 2024-01-08 23:13:59 UTC
Created attachment 160668 [details] [review]
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
Comment 2 David Nind 2024-01-09 05:26:38 UTC
Hi Aleisha.

I like this!

It looks like the patch(es) with the database update/system preference addition is missing...

David

Testing notes (using KTD and the sample data):

1. Search for higher-order for a single search result.
Comment 3 Aleisha Amohia 2024-01-09 19:47:05 UTC
Created attachment 160722 [details] [review]
Bug 35728: Add RedirectToSoleResult system preference
Comment 4 Aleisha Amohia 2024-01-09 19:47:07 UTC
Created attachment 160723 [details] [review]
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
Comment 5 Aleisha Amohia 2024-01-09 19:47:28 UTC
(In reply to David Nind from comment #2)
> Hi Aleisha.
> 
> I like this!
> 
> It looks like the patch(es) with the database update/system preference
> addition is missing...
> 
> David

Oops! There you go
Comment 6 David Nind 2024-01-09 20:22:57 UTC
Created attachment 160724 [details] [review]
Bug 35728: Add RedirectToSoleResult system preference

Signed-off-by: David Nind <david@davidnind.com>
Comment 7 David Nind 2024-01-09 20:22:59 UTC
Created attachment 160725 [details] [review]
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>
Comment 8 Magnus Enger 2024-01-10 07:05:32 UTC
Would it make sense to split this in two, with one syspref for the OPAC and one for staff?
Comment 9 Magnus Enger 2024-01-10 10:04:17 UTC
*** Bug 25885 has been marked as a duplicate of this bug. ***
Comment 10 Aleisha Amohia 2024-01-10 18:51:38 UTC
(In reply to Magnus Enger from comment #8)
> Would it make sense to split this in two, with one syspref for the OPAC and
> one for staff?

I don't think it is necessary at this point. The sponsorship we received didn't require this to be so granular, but it wouldn't be hard to split it out in future if that was desired.
Comment 11 Nick Clemens 2024-04-01 17:16:09 UTC
Created attachment 164214 [details] [review]
Bug 35728: Add RedirectToSoleResult system preference

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Comment 12 Nick Clemens 2024-04-01 17:16:11 UTC
Created attachment 164215 [details] [review]
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>