From 2bb51675aecbe118ce5a63c50f1351789f1c6c42 Mon Sep 17 00:00:00 2001 From: Michiel Nauta Date: Mon, 27 Jun 2011 15:21:40 +0000 Subject: [PATCH] 5046: GEDCOM import fails on aka name svn: r17839 --- src/gen/lib/surnamebase.py | 2 +- src/plugins/lib/libgedcom.py | 5 ++++- src/plugins/textreport/BirthdayReport.py | 3 ++- src/plugins/webreport/NarrativeWeb.py | 3 ++- 4 files changed, 9 insertions(+), 4 deletions(-) diff --git a/src/gen/lib/surnamebase.py b/src/gen/lib/surnamebase.py index 89cf13734..81ef1a62d 100644 --- a/src/gen/lib/surnamebase.py +++ b/src/gen/lib/surnamebase.py @@ -123,7 +123,7 @@ class SurnameBase(object): def get_primary_surname(self): """ - Return the string of the surname that is the primary surname + Return the surname that is the primary surname :returns: Returns the surname instance that is the primary surname. If primary not set, and there is a surname, diff --git a/src/plugins/lib/libgedcom.py b/src/plugins/lib/libgedcom.py index 1ed66c920..f46d8f34e 100644 --- a/src/plugins/lib/libgedcom.py +++ b/src/plugins/lib/libgedcom.py @@ -3340,7 +3340,10 @@ class GedcomParser(UpdateCallback): state.person.add_attribute(attr) else: name = gen.lib.Name() - name.set_surname(lname[-1].strip()) + surname = gen.lib.Surname() + surname.set_surname(lname[-1].strip()) + surname.set_primary() + name.set_surname_list([surname]) name.set_first_name(' '.join(lname[0:name_len-1])) state.person.add_alternate_name(name) diff --git a/src/plugins/textreport/BirthdayReport.py b/src/plugins/textreport/BirthdayReport.py index 163208b43..dfe81ff8b 100644 --- a/src/plugins/textreport/BirthdayReport.py +++ b/src/plugins/textreport/BirthdayReport.py @@ -108,7 +108,8 @@ class CalendarReport(Report): name = Name(married_name) else: name = Name(primary_name) - name.set_surname(maiden_name) + surname_obj = name.get_primary_surname() + surname_obj.set_surname(maiden_name) else: name = Name(primary_name) name.set_display_as(self.name_format) diff --git a/src/plugins/webreport/NarrativeWeb.py b/src/plugins/webreport/NarrativeWeb.py index 54ea2baf8..aefa22020 100644 --- a/src/plugins/webreport/NarrativeWeb.py +++ b/src/plugins/webreport/NarrativeWeb.py @@ -1009,7 +1009,8 @@ class BasePage(object): name = gen.lib.Name(married_name) else: name = gen.lib.Name(primary_name) - name.set_surname(maiden_name) + surname_obj = name.get_primary_surname() + surname_obj.set_surname(maiden_name) else: name = gen.lib.Name(primary_name) name.set_display_as(name_format)