]> git.evergreen-ils.org Git - evergreen/tadl.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:12:04 +0000 (16:12 -0400)
commitba607151a6307de5e9587b2aaa111c56149b12d5
treee33e69d6df4c791c7db10cf820f1e40a28d61eda
parent410d25c385b0fba65589e800be9f4ac16c36f93d
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