TPAC: don't repeat subfields in record content notes
authorDan Scott <dscott@laurentian.ca>
Fri, 26 Oct 2012 04:52:11 +0000 (00:52 -0400)
committerBen Shum <bshum@biblio.org>
Fri, 26 Oct 2012 14:37:09 +0000 (22:37 +0800)
Given a MARC field like "500 $a 1 $b 2 $c 3", the content note would
display as "1 1 2 1 2 3" as each subfield was appended to the total
set of notes.

Signed-off-by: Dan Scott <dscott@laurentian.ca>
Signed-off-by: Ben Shum <bshum@biblio.org>
Open-ILS/src/templates/opac/parts/record/contents.tt2

index 956a72d..1fb0eb5 100644 (file)
@@ -162,9 +162,10 @@ BLOCK render_contents;
             code = subfield.getAttribute('code');
             NEXT UNLESS code.match('[a-z]');
             all_content.push(subfield.textContent);
-            total_contents = all_content.join(" ").replace('\s+$', '');
-        %] [% total_contents %][%- END;
-        IF all_terms.size; "<br/>"; END;
+        END;
+        total_contents = all_content.join(" ").replace('\s+$', '');
+        %] [% total_contents;
+        IF total_contents.size; "<br/>"; END;
     END;
 END 
 %]