Bug 31967 - Search terms retained in header search when only one result
Summary: Search terms retained in header search when only one result
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Searching (show other bugs)
Version: master
Hardware: All All
: P5 - low normal (vote)
Assignee: Fridolin Somers
QA Contact: Martin Renvoize
URL:
Keywords:
Depends on: 26247
Blocks:
  Show dependency treegraph
 
Reported: 2022-10-25 06:28 UTC by Fridolin Somers
Modified: 2023-06-08 22:28 UTC (History)
1 user (show)

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


Attachments
Bug 31967: Search terms retained in header search when only one result (1.54 KB, patch)
2022-10-25 06:53 UTC, Fridolin Somers
Details | Diff | Splinter Review
Bug 31967: Search terms retained in header search when only one result (1.59 KB, patch)
2022-10-25 07:43 UTC, David Nind
Details | Diff | Splinter Review
Bug 31967: Search terms retained in header search when only one result (1.65 KB, patch)
2022-11-02 14:21 UTC, Martin Renvoize
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Fridolin Somers 2022-10-25 06:28:36 UTC
Bug 26247 added a system preference to manage the Retaining of search terms in header search.
But this does not work if there is only one match and you go directly to details page.
This needs to be fixed in Javascript :
https://git.koha-community.org/Koha-community/Koha/src/commit/b0cf6c087b9e23467b98faecd3eac1ec0d6bc968/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt#L1953
Comment 1 Fridolin Somers 2022-10-25 06:53:58 UTC
Created attachment 142600 [details] [review]
Bug 31967: Search terms retained in header search when only one result

Bug 26247 added a system preference to manage the Retaining of search terms in header search.
But this does not work if there is only one match and you go directly to details page.

Test plan :
1) Set system preference RetainCatalogSearchTerms to "Don't retain"
2) Perform a search leading to a single result.
   For example in KTD the ISBN 1932100083
=> Without patch search bar is populated with search terms
=> With patch search bar is not populated with search terms
Comment 2 Fridolin Somers 2022-10-25 06:56:27 UTC
Some librarians reported this is reaaaaaaally important since they search by scanning ISBN or item barcode.
Retaining search terms does not allow to scan another barcode directly.
Comment 3 David Nind 2022-10-25 07:43:24 UTC
Created attachment 142601 [details] [review]
Bug 31967: Search terms retained in header search when only one result

Bug 26247 added a system preference to manage the Retaining of search terms in header search.
But this does not work if there is only one match and you go directly to details page.

Test plan :
1) Set system preference RetainCatalogSearchTerms to "Don't retain"
2) Perform a search leading to a single result.
   For example in KTD the ISBN 1932100083
=> Without patch search bar is populated with search terms
=> With patch search bar is not populated with search terms

Signed-off-by: David Nind <david@davidnind.com>
Comment 4 Martin Renvoize 2022-11-02 14:21:48 UTC
Created attachment 142984 [details] [review]
Bug 31967: Search terms retained in header search when only one result

Bug 26247 added a system preference to manage the Retaining of search terms in header search.
But this does not work if there is only one match and you go directly to details page.

Test plan :
1) Set system preference RetainCatalogSearchTerms to "Don't retain"
2) Perform a search leading to a single result.
   For example in KTD the ISBN 1932100083
=> Without patch search bar is populated with search terms
=> With patch search bar is not populated with search terms

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Comment 5 Martin Renvoize 2022-11-02 14:22:18 UTC
Trivial fix, works.. Passing QA
Comment 6 Tomás Cohen Arazi 2022-11-07 14:01:41 UTC
Pushed to master for 22.11.

Nice work everyone, thanks!