diff --git a/gramps/gen/simple/_simpleaccess.py b/gramps/gen/simple/_simpleaccess.py index 95db7c293..49699ecfc 100644 --- a/gramps/gen/simple/_simpleaccess.py +++ b/gramps/gen/simple/_simpleaccess.py @@ -785,7 +785,8 @@ class SimpleAccess(object): """ with self.dbase.get_person_cursor() as cursor: - slist = sorted((data[3][3], key) for key, data in cursor) + # data[3] is primary_name; data[3][5][0][0] is surname + slist = sorted((data[3][5][0][0], key) for key, data in cursor) for info in slist: obj = self.dbase.get_person_from_handle(info[1])