From 66476fa1028bfe8d01cbc72996e951a2adaa86d0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tobias=20B=C3=BClte?= Date: Tue, 5 Nov 2024 09:47:42 +0100 Subject: [PATCH] Fix fallback for publication dates #2016 --- src/main/resources/alma/fix/titleRelatedFields.fix | 4 ++-- src/test/resources/alma-fix/99374153235806441.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/main/resources/alma/fix/titleRelatedFields.fix b/src/main/resources/alma/fix/titleRelatedFields.fix index 3c5a7c51c..514b789c8 100644 --- a/src/main/resources/alma/fix/titleRelatedFields.fix +++ b/src/main/resources/alma/fix/titleRelatedFields.fix @@ -258,14 +258,14 @@ if exists("publication[].$first") end end end - unless exists("publication[].$first.startDate[]") + unless exists("publication[].$first.startDate") if any_match("008","^.{6}[brestikm](\\d{4}).*$") copy_field("008","@008startDate") replace_all("@008startDate","^.{7}(\\d{4}).*$","$1") copy_field("@008startDate","publication[].$first.startDate") end end - unless exists("publication[].$first.endDate[]") + unless exists("publication[].$first.endDate") if any_match("008","^.{6}[km]\\d{4}(\\d{4}).*$") copy_field("008","@008endDate") replace_all("@008endDate","^.{11}(\\d{4}).*$","$1") diff --git a/src/test/resources/alma-fix/99374153235806441.json b/src/test/resources/alma-fix/99374153235806441.json index 43dad05bf..f4ac44bd8 100644 --- a/src/test/resources/alma-fix/99374153235806441.json +++ b/src/test/resources/alma-fix/99374153235806441.json @@ -16,7 +16,7 @@ "otherTitleInformation" : [ "Thüringen" ], "edition" : [ "1. Auflage" ], "publication" : [ { - "startDate" : "2088", + "startDate" : "2008", "type" : [ "PublicationEvent" ], "location" : [ "München" ], "publishedBy" : [ "Stark" ]