LP#1752434: (follow-up) fix un/highlighting of author name
authorGalen Charlton <gmc@equinoxinitiative.org>
Mon, 30 Apr 2018 18:43:02 +0000 (14:43 -0400)
committerGalen Charlton <gmc@equinoxinitiative.org>
Mon, 30 Apr 2018 18:44:34 +0000 (14:44 -0400)
This patch fixes a regression introduced by the previous patch
that caused portions of an author/contributor name that matched
a search to always be highlighted, regardless of whether or not
the user had turned off highlighting.

Signed-off-by: Galen Charlton <gmc@equinoxinitiative.org>
Open-ILS/src/templates/opac/parts/record/authors.tt2

index 4140e78..759a929 100644 (file)
@@ -28,7 +28,7 @@ BLOCK find_hl_value;
     norm_needle = PROCESS normalize_string(unnorm_string=needle);
     FOREACH hl IN attrs.display_field_list;
         norm_value = PROCESS normalize_string(unnorm_string=hl.value);
-        outlist.push(hl.highlight) IF norm_value == norm_needle;
+        outlist.push(hl.$f) IF norm_value == norm_needle;
     END;
 
     outlist.0;
@@ -138,7 +138,7 @@ BLOCK build_author_links;
 
         link_term = link_term.replace('^\s+', '');
         match_term = link_term _ ' ' _ birthdate _ ' ' _ deathdate;
-        matching_author_hl = PROCESS find_hl_value needle=match_term;
+        matching_author_hl = PROCESS find_hl_value needle=match_term f=attrs.hl_field;
 
         authtml = ' <span class="rdetail-author-div"' _ iprop _ ' resource="' _ contrib_ref _ '"><a href="' _ url _ '"><span resource="' _ contrib_ref _ '">';
         IF iprop; authtml = authtml _ '<span property="name">'; END;