TPAC Turn dashes into space in subject search links for better matching collab/senator/lp1167454
authorLebbeous Fogle-Weekley <lebbeous@esilibrary.com>
Wed, 10 Apr 2013 17:23:28 +0000 (13:23 -0400)
committerLebbeous Fogle-Weekley <lebbeous@esilibrary.com>
Wed, 10 Apr 2013 17:23:28 +0000 (13:23 -0400)
Thanks to Dan Wells for finding a bug and fixing it for demonstration
purposes.

Signed-off-by: Lebbeous Fogle-Weekley <lebbeous@esilibrary.com>
Open-ILS/src/templates/opac/parts/record/subjects.tt2

index 9a1cf50..3914908 100644 (file)
@@ -44,7 +44,7 @@
                 IF code.match('[vxyz]'); " &gt; "; END;
                 # at this point, we actually have a partial term to use.
                 single_term = subfield.textContent | html;
-                all_terms.push(subfield.textContent.replace('[#"^$\+\-,\.:;&|\[\]()]', ''));
+                all_terms.push(subfield.textContent.replace('\-', ' ').replace('[#"^$\+,\.:;&|\[\]()]', ''));
                 total_term = all_terms.join(" ").replace('\s+$', '');
             %]
 <a href="[% mkurl(ctx.opac_root _ '/results', {qtype=>'subject', query=>total_term}, stop_parms); %]">[% single_term %]</a>