From 2a10453af0ce28ed805d50a676e77cdd08066222 Mon Sep 17 00:00:00 2001 From: Michiel Nauta Date: Mon, 27 Jun 2011 15:20:56 +0000 Subject: [PATCH] 5046: GEDCOM import fails on aka name svn: r17838 --- 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 bdccf115e..78b32354e 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)