From bfdec5b1aa94916c971c8c5eabed1241b2623fb9 Mon Sep 17 00:00:00 2001 From: Niccolo Cantu Date: Wed, 30 Sep 2026 11:01:54 +0200 Subject: [PATCH] fix(gbif-eml): populate metadata.dates.creation for iso19139 export The ISO19139 template requires record['metadata']['dates']['creation'] with no fallback, but GBIF_EMLOutputSchema.import_() never set it, only identification.dates.publication. This caused a hard UndefinedError when rendering ISO19139 XML from GBIF-EML-imported MCF. Backfill metadata.dates.creation from the same publication date already extracted for identification.dates.publication. --- pygeometa/schemas/gbif_eml/__init__.py | 1 + 1 file changed, 1 insertion(+) diff --git a/pygeometa/schemas/gbif_eml/__init__.py b/pygeometa/schemas/gbif_eml/__init__.py index 4fe2467f..60d0366c 100644 --- a/pygeometa/schemas/gbif_eml/__init__.py +++ b/pygeometa/schemas/gbif_eml/__init__.py @@ -172,6 +172,7 @@ def import_(self, metadata): idf['dates'] = { 'publication': text_or_null(dataset.find('pubDate'), strip=True) } + mcf['metadata']['dates'] = {'creation': idf['dates']['publication']} idf['extents'] = {} if coords := dataset.find('boundingCoordinates'):