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

Signed-off-by: Lebbeous Fogle-Weekley <lebbeous@esilibrary.com>
Signed-off-by: Dan Wells <dbw2@calvin.edu>
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>