From: Bill Erickson Date: Mon, 24 Oct 2011 17:52:14 +0000 (-0400) Subject: TPac; improved UPC extraction X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=3759c86cc548f11f58ea54792e4b886bde6b7b53;p=evergreen%2Fpines.git 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 --- 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;