From 06fcf29136d847d72eba5a86f5a04f16f5c7e144 Mon Sep 17 00:00:00 2001 From: prculley Date: Thu, 14 Jul 2016 10:02:50 -0500 Subject: [PATCH] Fix for either valid or invalid FTM Gedcom --- data/tests/imp_FTM_OCCU_bug.ged | 37 ++++++++++++++++ data/tests/imp_FTM_OCCU_bug.gramps | 69 ++++++++++++++++++++++++++++++ gramps/plugins/lib/libgedcom.py | 3 +- 3 files changed, 108 insertions(+), 1 deletion(-) create mode 100644 data/tests/imp_FTM_OCCU_bug.ged create mode 100644 data/tests/imp_FTM_OCCU_bug.gramps diff --git a/data/tests/imp_FTM_OCCU_bug.ged b/data/tests/imp_FTM_OCCU_bug.ged new file mode 100644 index 000000000..4b392c6bd --- /dev/null +++ b/data/tests/imp_FTM_OCCU_bug.ged @@ -0,0 +1,37 @@ +0 HEAD +1 SOUR FTM +2 VERS Family Tree Maker (21.0.0.723) +2 NAME Family Tree Maker for Windows +2 CORP Ancestry.com +3 ADDR 360 W 4800 N +4 CONT Provo, UT 84604 +3 PHON (801) 705-7000 +1 DEST GED55 +1 DATE 11 DEC 2013 +1 CHAR UTF-8 +1 FILE D:\Family Tree Maker\imp_FTM_OCCU_bug.ged +1 SUBM @SUBM@ +1 GEDC +2 VERS 5.5 +2 FORM LINEAGE-LINKED +0 @SUBM@ SUBM +0 @I1@ INDI +1 NAME The /Tester/ +1 OCCU Working at Halle's Department Store +2 DATE 16 OCT 1946 +2 PLAC Cleveland, Cuyahoga, Ohio, United States of America +1 OCCU +2 DATE 06 JUL 1950 +2 PLAC Shoemaker +1 RELI Methodist +2 DATE 06 JUL 1940 +1 RELI +2 PLAC Lutherin +2 DATE 06 JUL 1950 +1 _DEG High School +2 PLAC Norwalk, Ohio, USA +2 DATE 06 JUL 1935 +1 _DEG +2 PLAC Case Western University +2 DATE 06 JUL 1939 +0 TRLR diff --git a/data/tests/imp_FTM_OCCU_bug.gramps b/data/tests/imp_FTM_OCCU_bug.gramps new file mode 100644 index 000000000..519ccfbb2 --- /dev/null +++ b/data/tests/imp_FTM_OCCU_bug.gramps @@ -0,0 +1,69 @@ + + + +
+ + + +
+ + + Occupation + + + Working at Halle's Department Store + + + Occupation + + Shoemaker + + + Religion + + Methodist + + + Religion + + Lutherin + + + Degree + + + High School + + + Degree + + Case Western University + + + + + U + + The + Tester + + + + + + + + + + + + Cleveland, Cuyahoga, Ohio, United States of America + + + + Norwalk, Ohio, USA + + + +
diff --git a/gramps/plugins/lib/libgedcom.py b/gramps/plugins/lib/libgedcom.py index 8bc58dd18..376990342 100755 --- a/gramps/plugins/lib/libgedcom.py +++ b/gramps/plugins/lib/libgedcom.py @@ -5416,7 +5416,8 @@ class GedcomParser(UpdateCallback): @type state: CurrentState """ - if self.is_ftw and state.event.type in FTW_BAD_PLACE: + if self.is_ftw and (state.event.type in FTW_BAD_PLACE) \ + and not state.event.get_description(): state.event.set_description(line.data) else: title = line.data