From 3759c86cc548f11f58ea54792e4b886bde6b7b53 Mon Sep 17 00:00:00 2001 From: Bill Erickson Date: Mon, 24 Oct 2011 13:52:14 -0400 Subject: [PATCH] TPac; improved UPC extraction Handle the case where a record has multiple UPC's. When this occurs, use the first UPC as the value for added content lookups as necessary. Signed-off-by: Bill Erickson Signed-off-by: Lebbeous Fogle-Weekley --- Open-ILS/src/templates/opac/parts/misc_util.tt2 | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Open-ILS/src/templates/opac/parts/misc_util.tt2 b/Open-ILS/src/templates/opac/parts/misc_util.tt2 index 38944f6122..308998407c 100644 --- a/Open-ILS/src/templates/opac/parts/misc_util.tt2 +++ b/Open-ILS/src/templates/opac/parts/misc_util.tt2 @@ -7,7 +7,11 @@ FOR isbn IN xml.findnodes('//*[@tag="020"]/*[@code="a"]'); args.isbns.push(isbn.textContent); END; - args.upc = xml.findnodes('//*[@tag="024"]/*[@code="a"]').textContent; + args.upcs = []; + FOR upc IN xml.findnodes('//*[@tag="024"]/*[@code="a"]'); + args.upcs.push(upc.textContent); + END; + args.upc = args.upcs.0; # use first UPC as the default args.issn = xml.findnodes('//*[@tag="022"]/*[@code="a"]').textContent; args.title = xml.findnodes('//*[@tag="245"]/*[@code="a"]').textContent; args.title_extended = xml.findnodes('//*[@tag="245"]').textContent; -- 2.11.0