From 87d4eac98ea9c36dffc84cf13e3f61161d28874a Mon Sep 17 00:00:00 2001 From: Jan Kissig Date: Wed, 24 Jun 2026 09:14:42 +0000 Subject: [PATCH] Bug 42292: (QA follow-up) Fix evaluation of OpacHighlightedWords to be numeric in opac-results OpacHighlightedWords was set in quotation marks and resulted in either "1" or "0". As "0" and "1" always evaluates to true in JS the following error was thrown when OpacHighlightedWords was set to Don't highlight: Uncaught TypeError: $(...).highlight is not a function To test: a) Set system preference OpacHighlightedWords to Don't highlight b) search a title in the opac with open dev console and check that no error (like above) is thrown. Signed-off-by: Pedro Amorim --- koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-results.tt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-results.tt b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-results.tt index 91424f167d..8da6fb0f4d 100644 --- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-results.tt +++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-results.tt @@ -488,7 +488,7 @@ var theme = "[% theme | html %]"; const firstPage = [% firstPage ? 1 : 0 | html %]; Koha.addPrefs({ - OpacHighlightedWords: "[% Koha.Preference('OpacHighlightedWords') | html %]", + OpacHighlightedWords: [% Koha.Preference('OpacHighlightedWords') ? 1 : 0 | html %], NotHighlightedWords: "[% Koha.Preference("NotHighlightedWords") | html %]", GoogleJackets: [% Koha.Preference("GoogleJackets") ? 1 : 0 | html %], OpenLibraryCovers: [% Koha.Preference("OpenLibraryCovers") ? 1 : 0 | html %],