diff --git a/src/Filters/Rules/Person/_IncompleteNames.py b/src/Filters/Rules/Person/_IncompleteNames.py index 75ed230f1..18ea4e6e7 100644 --- a/src/Filters/Rules/Person/_IncompleteNames.py +++ b/src/Filters/Rules/Person/_IncompleteNames.py @@ -50,9 +50,10 @@ class IncompleteNames(Rule): for name in [person.get_primary_name()] + person.get_alternate_names(): if name.get_first_name().strip() == "": return True - for surn in name.get_surname_list(): - if surn.get_surname().strip() == "": - return True + if name.get_surname_list(): + for surn in name.get_surname_list(): + if surn.get_surname().strip() == "": + return True else: return True return False diff --git a/src/plugins/gramplet/StatsGramplet.py b/src/plugins/gramplet/StatsGramplet.py index a0a4159d0..daf266c29 100644 --- a/src/plugins/gramplet/StatsGramplet.py +++ b/src/plugins/gramplet/StatsGramplet.py @@ -103,12 +103,16 @@ class StatsGramplet(Gramplet): with_media += 1 total_media += length - names = [person.get_primary_name()] + person.get_alternate_names() - for name in names: - if (name.get_first_name() == "" or name.get_group_name() == ""): + for name in [person.get_primary_name()] + person.get_alternate_names(): + if name.get_first_name().strip() == "": incomp_names += 1 - if name.get_group_name() not in namelist: - namelist.append(name.get_group_name()) + else: + if name.get_surname_list(): + for surname in name.get_surname_list(): + if surname.get_surname().strip() == "": + incomp_names += 1 + else: + incomp_names += 1 if (not person.get_main_parents_family_handle() and not len(person.get_family_handle_list())): diff --git a/src/plugins/quickview/FilterByName.py b/src/plugins/quickview/FilterByName.py index 0e56c2c4e..1bf8943c1 100644 --- a/src/plugins/quickview/FilterByName.py +++ b/src/plugins/quickview/FilterByName.py @@ -281,10 +281,21 @@ def run(database, document, filter_name, *args, **kwargs): stab.columns(_("Name"), _("Birth Date"), _("Name type")) for person in database.iter_people(): for name in [person.get_primary_name()] + person.get_alternate_names(): - if name.get_group_name() == "" or name.get_first_name() == "": + if name.get_first_name().strip() == "": stab.row([name.get_name(), "Person", person.handle], sdb.birth_or_fallback(person), str(name.get_type())) matches += 1 + else: + if name.get_surname_list(): + for surname in name.get_surname_list(): + if surname.get_surname().strip() == "": + stab.row([name.get_first_name(), "Person", person.handle], sdb.birth_or_fallback(person), + str(name.get_type())) + matches += 1 + else: + stab.row([name.get_first_name(), "Person", person.handle], sdb.birth_or_fallback(person), + str(name.get_type())) + matches += 1 elif (filter_name == 'people with missing birth dates'): stab.columns(_("Person"), _("Type"))