]> git.evergreen-ils.org Git - Evergreen.git/commit
TPAC: Handle multiple matches for an XPath expression
authorDan Scott <dan@coffeecode.net>
Fri, 15 Jun 2012 17:25:29 +0000 (13:25 -0400)
committerDan Scott <dscott@laurentian.ca>
Wed, 11 Jul 2012 20:10:28 +0000 (16:10 -0400)
commitb7d90ccbd7d6fddb88dc9149148e580d55ba6f0c
tree55f778f1088c47b9f5705b9aeb507e8590bb8b3e
parentbbf645e0f936ca4b0b5b29b070abfbdee29bb5dc
TPAC: Handle multiple matches for an XPath expression

Per LP 1009980, "If a record has multiple subfield b's in the 260 field,
tpac will not display the publisher or publication date in the record
details page and will not display the publisher on the search results
page".

This is because we're calling textContent on a nodeset, rather than an
individual node, and therefore get null back rather than any content.

To avoid this, always expect a nodeset and iterate over it to populate a
list of the strings.  To maintain the same semantics of expecting a
single text string back for, say, args.pubdate, we define the list as
args.pubdates (plural name), and then grab the first item from the list
and populate that as args.pubdate (singular name).

Signed-off-by: Dan Scott <dan@coffeecode.net>
Signed-off-by: Ben Shum <bshum@biblio.org>
Open-ILS/src/templates/opac/parts/misc_util.tt2