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 <pedro.amorim@openfifth.co.uk>
This commit is contained in:
parent
71b121bb6f
commit
87d4eac98e
|
|
@ -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 %],
|
||||
|
|
|
|||
Loading…
Reference in New Issue