From 450217a6362a5bffc1382241a2a4f4f25fe53fec Mon Sep 17 00:00:00 2001 From: Paul Culley Date: Sun, 17 Mar 2019 00:51:15 -0500 Subject: [PATCH] Fix Gedcom import so it doesn't create completely empty Birth events (#799) Fixes #10145 Note: a completely empty birth event is removed by Check and Repair; this is wrong in that sometimes we know a person is born, but not date/place. In Gedcom this is indicated by "1 BIRT Y" lines. So this PR adds a description to the birth event. This is not an issue for other event types, the C&R tool sees the non-default type and leaves it alone, but birth is the default type. --- data/tests/imp_sample.gramps | 3 ++- gramps/plugins/lib/libgedcom.py | 3 +++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/data/tests/imp_sample.gramps b/data/tests/imp_sample.gramps index abc9822a3..93a1285d2 100644 --- a/data/tests/imp_sample.gramps +++ b/data/tests/imp_sample.gramps @@ -163,6 +163,7 @@ Birth + No Date Information Death @@ -1703,7 +1704,7 @@ Unknown tag Line 1109: - + Objects referenced by this note were missing in a file imported on 12/25/1999 12:00:00 AM. diff --git a/gramps/plugins/lib/libgedcom.py b/gramps/plugins/lib/libgedcom.py index 49900f30d..8363b0a94 100644 --- a/gramps/plugins/lib/libgedcom.py +++ b/gramps/plugins/lib/libgedcom.py @@ -7827,6 +7827,9 @@ class GedcomParser(UpdateCallback): sub_state.pf = self.place_parser self.__parse_level(sub_state, event_map, self.__undefined) + if(description == 'Y' and event.date.is_empty() and + event.type == EventType.BIRTH and not event.place): + event.set_description(_("No Date Information")) state.msg += sub_state.msg self.__add_place(event, sub_state)