[open-ils-commits] [GIT] Evergreen ILS branch rel_3_1 updated. 2bcb04b90e23bbd573e942d00a5fc89050ee85ef

Evergreen Git git at git.evergreen-ils.org
Mon Apr 30 14:45:27 EDT 2018


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Evergreen ILS".

The branch, rel_3_1 has been updated
       via  2bcb04b90e23bbd573e942d00a5fc89050ee85ef (commit)
       via  92d001f6ea320263228965702fd5bb56372f2bb3 (commit)
      from  940bf22be81ed0a53a3e1886e4c2ad14c046e3b0 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 2bcb04b90e23bbd573e942d00a5fc89050ee85ef
Author: Galen Charlton <gmc at equinoxinitiative.org>
Date:   Mon Apr 30 14:43:02 2018 -0400

    LP#1752434: (follow-up) fix un/highlighting of author name
    
    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 at equinoxinitiative.org>

diff --git a/Open-ILS/src/templates/opac/parts/record/authors.tt2 b/Open-ILS/src/templates/opac/parts/record/authors.tt2
index 4140e78..759a929 100644
--- a/Open-ILS/src/templates/opac/parts/record/authors.tt2
+++ b/Open-ILS/src/templates/opac/parts/record/authors.tt2
@@ -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;

commit 92d001f6ea320263228965702fd5bb56372f2bb3
Author: Mike Rylander <mrylander at gmail.com>
Date:   Thu Mar 1 15:34:02 2018 -0500

    LP#1752434: Use display fields even when not highlighting
    
    Always retrieve display field data, and decide whether to use the highlighted
    version of each based on the configuration and user option rather than falling
    back to template-side MARC extraction when not highlighting.
    
    Signed-off-by: Mike Rylander <mrylander at gmail.com>
    Signed-off-by: Remington Steed <rjs7 at calvin.edu>
    Signed-off-by: Galen Charlton <gmc at equinoxinitiative.org>

diff --git a/Open-ILS/src/templates/opac/parts/misc_util.tt2 b/Open-ILS/src/templates/opac/parts/misc_util.tt2
index e4bf98c..6f3d18b 100644
--- a/Open-ILS/src/templates/opac/parts/misc_util.tt2
+++ b/Open-ILS/src/templates/opac/parts/misc_util.tt2
@@ -108,28 +108,33 @@
 
         args.display_fields = {};
         args.hl = {};
-        IF !CGI.param('no_highlight') && !search.no_highlight;
-
-            args.display_field_list = ctx.fetch_display_fields(args.df_bib_list.list);
-
-            junk = ctx.timelog('Mapping highlighted display fields for bib(s) ' _ args.df_bib_list.list.join(', ')); 
-            FOR df IN args.display_field_list;
-                df_map = ctx.search_cdfm('field', df.field).0;
-                df_name = df_map.name();
-                IF df_map.multi() == 't';
-                    IF NOT args.hl_display_fields.$df_name;
-                        args.hl_display_fields.$df_name = [];
-                        args.hl.$df_name = [];
-                    END;
-                    args.hl_display_fields.$df_name.push(df);
-                    args.hl.$df_name.push(df.highlight || df.value);
-                ELSIF !args.hl_display_fields.$df_name.defined;
-                    args.hl_display_fields.$df_name = df;
-                    args.hl.$df_name = df.highlight || df.value;
+
+        args.hl_field = 'highlight';
+        IF CGI.param('no_highlight') || search.no_highlight;
+            args.hl_field = 'value';
+        END;
+        hl_field = args.hl_field;
+
+        junk = ctx.timelog('Fetching display fields and Using data from "' _ hl_field _ '" for rendering'); 
+        args.display_field_list = ctx.fetch_display_fields(args.df_bib_list.list);
+
+        junk = ctx.timelog('Mapping display fields for bib(s) ' _ args.df_bib_list.list.join(', ')); 
+        FOR df IN args.display_field_list;
+            df_map = ctx.search_cdfm('field', df.field).0;
+            df_name = df_map.name();
+            IF df_map.multi() == 't';
+                IF NOT args.hl_display_fields.$df_name;
+                    args.hl_display_fields.$df_name = [];
+                    args.hl.$df_name = [];
                 END;
+                args.hl_display_fields.$df_name.push(df);
+                args.hl.$df_name.push(df.$hl_field || df.value);
+            ELSIF !args.hl_display_fields.$df_name.defined;
+                args.hl_display_fields.$df_name = df;
+                args.hl.$df_name = df.$hl_field || df.value;
             END;
-            junk = ctx.timelog('Finished mapping highlighted display fields for bib(s) ' _ args.df_bib_list.list.join(', ')); 
         END;
+        junk = ctx.timelog('Finished mapping display fields for bib(s) ' _ args.df_bib_list.list.join(', ')); 
 
         # Map item types to schema.org types; impedance mismatch :(
         args.schema.itemtype = {};
diff --git a/Open-ILS/src/templates/opac/parts/record/series.tt2 b/Open-ILS/src/templates/opac/parts/record/series.tt2
index 4c42baf..a5ad664 100644
--- a/Open-ILS/src/templates/opac/parts/record/series.tt2
+++ b/Open-ILS/src/templates/opac/parts/record/series.tt2
@@ -5,13 +5,14 @@
 BLOCK render_series;
     results = [];
     IF attrs.hl_display_fields.series_title.size;
+        hl_field = attrs.hl_field;
         FOREACH s IN attrs.hl_display_fields.series_title;
             search_term = s.value.replace('[#"^$\+\-,\.:;&|\[\]()]', ' ').replace('\s+$', '') | html;
     
             url = mkurl(ctx.opac_root _ '/results',
                 { qtype=>'series', query=>search_term }, stop_parms.merge(expert_search_parms, general_search_parms, browse_search_parms, facet_search_parms)
             );
-            series = '<a href="' _ url _ '">' _ s.highlight _ '</a> ';
+            series = '<a href="' _ url _ '">' _ s.$hl_field _ '</a> ';
             results.push(series);
         END;
     ELSE;
diff --git a/Open-ILS/src/templates/opac/parts/record/subjects.tt2 b/Open-ILS/src/templates/opac/parts/record/subjects.tt2
index 73ae64f..f987125 100644
--- a/Open-ILS/src/templates/opac/parts/record/subjects.tt2
+++ b/Open-ILS/src/templates/opac/parts/record/subjects.tt2
@@ -91,7 +91,7 @@
         '<span property="about"><!-- highlighted -->';
         %]<a href="[%-
                mkurl(ctx.opac_root _ '/results', {qtype=>'subject', query=>total_term}, stop_parms.merge(expert_search_parms, general_search_parms, browse_search_parms, facet_search_parms))
-        -%]">[% s.highlight %]</a> [%-
+        -%]">[% s.$f %]</a> [%-
         '</span>';
     END;
 %]
@@ -104,7 +104,7 @@
             content = [];
             FOREACH hl_s IN attrs.hl_display_fields.$df;
                 hl_s.facet = subj.facet;
-                next_s = PROCESS render_hl_subject(s=hl_s);
+                next_s = PROCESS render_hl_subject(s=hl_s,f=attrs.hl_field);
                 content.push(next_s);
             END;
 

-----------------------------------------------------------------------

Summary of changes:
 Open-ILS/src/templates/opac/parts/misc_util.tt2    |   43 +++++++++++---------
 .../src/templates/opac/parts/record/authors.tt2    |    4 +-
 .../src/templates/opac/parts/record/series.tt2     |    3 +-
 .../src/templates/opac/parts/record/subjects.tt2   |    4 +-
 4 files changed, 30 insertions(+), 24 deletions(-)


hooks/post-receive
-- 
Evergreen ILS


More information about the open-ils-commits mailing list