Bug 35192 - Highlight search terms in OPAC Title notes tab
Summary: Highlight search terms in OPAC Title notes tab
Status: Signed Off
Alias: None
Product: Koha
Classification: Unclassified
Component: OPAC (show other bugs)
Version: Main
Hardware: All All
: P5 - low enhancement
Assignee: Alex Buckley
QA Contact: Testopia
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-10-30 19:05 UTC by Alex Buckley
Modified: 2025-11-28 03:28 UTC (History)
1 user (show)

See Also:
GIT URL:
Initiative type: ---
Sponsorship status: Sponsored
Comma delimited list of Sponsors:
Crowdfunding goal: 0
Patch complexity: ---
Documentation contact:
Documentation submission:
Text to go in the release notes:
This enhancement highlights matching search terms in the OPAC record details page notes tab (when the OpacHighlightedWords system preference is set to 'Highlight').
Version(s) released in:
Circulation function:


Attachments
Bug 35192: Highlight search terms in the OPAC Title notes tab (1.88 KB, patch)
2023-10-30 19:21 UTC, Alex Buckley
Details | Diff | Splinter Review
Bug 35192: Highlight search terms in the OPAC Title notes tab (1.88 KB, patch)
2025-11-24 20:01 UTC, Alex Buckley
Details | Diff | Splinter Review
The search term 'fish' is highighted in the OPAC title notes tab in Google Chrome (64.71 KB, image/png)
2025-11-24 20:01 UTC, Alex Buckley
Details
Bug 35192: Highlight search terms in the OPAC Title notes tab (1.92 KB, patch)
2025-11-28 03:26 UTC, David Nind
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Alex Buckley 2023-10-30 19:05:59 UTC
It would be nice if Koha could highlight the search term in the title notes tab of a OPAC biblio detail page.
Comment 1 Alex Buckley 2023-10-30 19:21:34 UTC
Created attachment 158101 [details] [review]
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
Comment 2 David Nind 2023-11-02 20:07:33 UTC
From my testing, words in the title notes tab are not highlighted.

The only JS error in the console is about downloadable fonts - there is a bug for this (Bug 34973).
Comment 3 Alex Buckley 2025-11-24 20:01:10 UTC
Created attachment 189918 [details] [review]
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
Comment 4 Alex Buckley 2025-11-24 20:01:58 UTC
Created attachment 189919 [details]
The search term 'fish' is highighted in the OPAC title notes tab in Google Chrome
Comment 5 Alex Buckley 2025-11-24 20:04:06 UTC
(In reply to David Nind from comment #2)
> From my testing, words in the title notes tab are not highlighted.
> 
> The only JS error in the console is about downloadable fonts - there is a
> bug for this (Bug 34973).

Hi David, 

It was lovely to see you last week at Kohacon!!

I've reworked this fix and have tested on main in Google Chrome and Mozilla Firefox. Could you please re-test when you have a moment and let me know if the test problems you found in comment #2 are now resolved?

Many thanks,
Alex
Comment 6 David Nind 2025-11-28 03:26:25 UTC
Created attachment 190001 [details] [review]
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
Signed-off-by: David Nind <david@davidnind.com>