From 3e97bb9003c527b2a321cf3f87c95f912517c785 Mon Sep 17 00:00:00 2001 From: Michiel Nauta Date: Mon, 31 Jan 2011 18:59:46 +0000 Subject: [PATCH] sort_as and display_as of a name was ignored on import if only one is specified. svn: r16516 --- src/plugins/import/ImportXml.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/plugins/import/ImportXml.py b/src/plugins/import/ImportXml.py index b9e3fc33f..976bf75d6 100644 --- a/src/plugins/import/ImportXml.py +++ b/src/plugins/import/ImportXml.py @@ -1315,14 +1315,18 @@ class GrampsParser(UpdateCallback): self.alt_name = bool(attrs.get("alt", 0)) try: sort_as = int(attrs["sort"]) - display_as = int(attrs["display"]) - # check if these pointers need to be remapped # and set the name attributes if sort_as in self.name_formats_map: self.name.sort_as = self.name_formats_map[sort_as] else: self.name.sort_as = sort_as + except KeyError: + pass + try: + display_as = int(attrs["display"]) + # check if these pointers need to be remapped + # and set the name attributes if display_as in self.name_formats_map: self.name.sort_as = self.name_formats_map[display_as] else: