From 8ffa78ad19e6fdbfddbf37b08fbb36d32586afd7 Mon Sep 17 00:00:00 2001 From: Nick Hall Date: Tue, 15 Jul 2014 19:37:04 +0100 Subject: [PATCH] 7915: Prevent user creating a cycle in the place hierarchy --- gramps/gui/editors/editplaceref.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/gramps/gui/editors/editplaceref.py b/gramps/gui/editors/editplaceref.py index 58481bfc8..03aeeb92f 100644 --- a/gramps/gui/editors/editplaceref.py +++ b/gramps/gui/editors/editplaceref.py @@ -74,9 +74,10 @@ class EditPlaceRef(EditSecondary): skip = [handle] while todo: handle = todo.pop() - for child in self.dbstate.db.find_place_child_handles(handle): - todo.append(child) - skip.append(child) + for child in self.db.find_backlink_handles(handle, ['Place']): + if child[1] not in skip: + todo.append(child[1]) + skip.append(child[1]) return skip def select_parent(self, button):