From e63e835aa88e2a063b532a59834845d9ec72e76a Mon Sep 17 00:00:00 2001 From: Alex Buckley Date: Mon, 30 Oct 2023 19:03:35 +0000 Subject: [PATCH] Bug 35192: Highlight search terms in the OPAC Title notes tab Test plan: 1. Create a biblio record with the word 'Fish' in the title (245$a) and the summary (520$a) 2. Set 'OpacHighlightedWords' system preference to 'Highlight' 3. Submit an OPAC search with the search term of 'Fish'. Click on the biblio created in #1 4. Notice 'Fish' in the title is highlighted, as is the Summary. Scroll down to the Holdings table. Click on 'Title notes' and notice 'Fish' is not highlighted in the 'Title notes' 5. Apply patch and restart services 6. Refresh the biblio page. Click on the 'Title notes' tab again 7. Notice 'Fish' is highlighted in the 'Title notes' tab 8. Right click, click 'Inspect element'. Confirm there are no JavaScript errors in the console. Sponsored-by: Catalyst IT, New Zealand --- koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-detail.tt | 1 + 1 file changed, 1 insertion(+) diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-detail.tt b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-detail.tt index 0c85fbb7353..6852c7b7c8d 100644 --- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-detail.tt +++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-detail.tt @@ -1665,6 +1665,7 @@ q_array[x] = q_array[x].toLowerCase(); var myStopwords = "[% Koha.Preference('NotHighlightedWords') | html %]".toLowerCase().split('|'); if( $.inArray(q_array[x], myStopwords) == -1 ) { + $("#marcnotes").highlight(q_array[x]); $(".title").highlight(q_array[x]); $(".author").highlight(q_array[x]); $(".results_summary").highlight(q_array[x]); -- 2.39.5