From 1290cc1aa8a8c4f5a535548cd56d917576ed5fd1 Mon Sep 17 00:00:00 2001 From: Dan Scott Date: Tue, 8 Jan 2013 17:02:38 -0500 Subject: [PATCH] TPAC: Prevent numeric subfields in series display Series fields can theoretically contain linking subfields ($6, $8) and other numeric subfields that aren't meant to be displayed. So, do not display them. Signed-off-by: Dan Scott Signed-off-by: Ben Shum --- .../src/templates/opac/parts/record/series.tt2 | 27 ++++++++++++++-------- 1 file changed, 18 insertions(+), 9 deletions(-) diff --git a/Open-ILS/src/templates/opac/parts/record/series.tt2 b/Open-ILS/src/templates/opac/parts/record/series.tt2 index aa96243ca3..6a604af2b3 100644 --- a/Open-ILS/src/templates/opac/parts/record/series.tt2 +++ b/Open-ILS/src/templates/opac/parts/record/series.tt2 @@ -6,16 +6,25 @@ [% BLOCK render_series; results = []; FOR tag IN series_tags; - FOR node IN ctx.marc_xml.findnodes('//*[@tag="' _ tag _ '"]/*'); - node_uri = node.textContent.replace('[#"^$\+\-,\.:;&|\[\]()]', '') | uri; - node_html = node.textContent | html; - IF !loop.first; - results.last = result.last _ ''; + FOR node IN ctx.marc_xml.findnodes('//*[@tag="' _ tag _ '"]'); + series = ''; + series_link = ''; + FOR subfield IN node.childNodes; + NEXT UNLESS subfield.nodeName == "subfield"; + code = subfield.getAttribute('code'); + NEXT UNLESS code.match('[a-z]'); + node_uri = subfield.textContent.replace('[#"^$\+\-,\.:;&|\[\]()]', '') | uri; + node_html = subfield.textContent | html; + IF !loop.first; + series = series _ ' '; + END; + series_link = series_link _ ' ' _ node_uri; + series = series _ ('' _ node_html _ '' + ); END; - results.push('' _ node_html _ '' - ); + results.push(series); END; END; FOR entry IN results; -- 2.11.0