Skip to content

Commit

Permalink
Fix fallback for publication dates #2016
Browse files Browse the repository at this point in the history
Due to wrong pathname 008 has overwritten correct publication dates.
  • Loading branch information
TobiasNx committed Nov 6, 2024
1 parent 194e721 commit cbb69b7
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/main/resources/alma/fix/titleRelatedFields.fix
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down
2 changes: 1 addition & 1 deletion src/test/resources/alma-fix/99374153235806441.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
"otherTitleInformation" : [ "Thüringen" ],
"edition" : [ "1. Auflage" ],
"publication" : [ {
"startDate" : "2088",
"startDate" : "2008",
"type" : [ "PublicationEvent" ],
"location" : [ "München" ],
"publishedBy" : [ "Stark" ]
Expand Down

0 comments on commit cbb69b7

Please sign in to comment.