From 29f71b28b2bc9b56987654f8ee0c6427b9fd3979 Mon Sep 17 00:00:00 2001 From: Dan Scott Date: Fri, 10 May 2013 13:12:55 -0400 Subject: [PATCH 1/1] TPAC: Death date missing from authors in record details The trailing period prescribed by ISBD punctuation for x00 $d subfields in certain circumstances confounds the regex that was expected the $d subfield to match ^\s*\d{4}-\d{4}\s*$. As a result, death dates were often being omitted from the record detail display. Relaxing the regex to match against a trailing .* instead of \s* resolves the issue. Signed-off-by: Dan Scott Signed-off-by: Pasi Kallinen Signed-off-by: Ben Shum --- Open-ILS/src/templates/opac/parts/record/authors.tt2 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Open-ILS/src/templates/opac/parts/record/authors.tt2 b/Open-ILS/src/templates/opac/parts/record/authors.tt2 index 7205e8f0ae..d2adff065d 100644 --- a/Open-ILS/src/templates/opac/parts/record/authors.tt2 +++ b/Open-ILS/src/templates/opac/parts/record/authors.tt2 @@ -55,8 +55,8 @@ BLOCK build_author_links; IF subfield.textContent.match('^\s*\d{4}'); birthdate = subfield.textContent.replace('^\s*(\d{4}).*$', '$1'); END; - IF subfield.textContent.match('-\d{4}\s*$'); - deathdate = subfield.textContent.replace('^\s*.{4}\-(\d{4})\s*$', '$1'); + IF subfield.textContent.match('-\d{4}.*$'); + deathdate = subfield.textContent.replace('^\s*.{4}\-(\d{4}).*$', '$1'); END; ELSE; term = term _ ' ' _ sf; -- 2.43.2