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>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
This commit is contained in:
Fridolin Somers 2022-10-24 20:47:41 -10:00 committed by Tomas Cohen Arazi
parent 499de13006
commit 13efec8a26
No known key found for this signature in database
GPG Key ID: 0A272EA1B2F3C15F
1 changed files with 1 additions and 1 deletions

View File

@ -1954,7 +1954,7 @@ Note that permanent location is a code, and location may be an authval.
});
[% IF (found1) %]
[% IF found1 && Koha.Preference('RetainCatalogSearchTerms') %]
$(document).ready(function() {
var search_index = localStorage.getItem("cat_search_pulldown_selection");
var search_value = localStorage.getItem("searchbox_value");