From cbb69b71689ffb8fc060114d9d3d3cfe331db6f6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tobias=20B=C3=BClte?= Date: Wed, 6 Nov 2024 11:32:54 +0100 Subject: [PATCH] Fix fallback for publication dates #2016 Due to wrong pathname 008 has overwritten correct publication dates. --- 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 70fdcc80c..92c8ae1ac 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" ]