From 9938c71a1c92a8b10f251725c19f39f9de7dad2b Mon Sep 17 00:00:00 2001 From: Paul Culley Date: Mon, 14 Sep 2020 11:12:12 -0500 Subject: [PATCH] Fix EditEventRef, EditPlaceRef, EditMediaRef, EditRepoRef for improperly (#1112) saving objects in their object lists. Fixes #11917, #11933 --- gramps/gui/editors/editeventref.py | 4 ++-- gramps/gui/editors/editmediaref.py | 3 ++- gramps/gui/editors/editplaceref.py | 4 ++-- gramps/gui/editors/editreporef.py | 4 ++-- 4 files changed, 8 insertions(+), 7 deletions(-) diff --git a/gramps/gui/editors/editeventref.py b/gramps/gui/editors/editeventref.py index f9528aabb..fd7afcac2 100644 --- a/gramps/gui/editors/editeventref.py +++ b/gramps/gui/editors/editeventref.py @@ -26,7 +26,7 @@ # Python modules # #------------------------------------------------------------------------- - +from copy import deepcopy #------------------------------------------------------------------------- # # gramps modules @@ -66,7 +66,7 @@ class EditEventRef(EditReference): def __init__(self, state, uistate, track, event, event_ref, update): EditReference.__init__(self, state, uistate, track, event, event_ref, update) - self.original = event.serialize() + self.original = deepcopy(event.serialize()) self._init_event() def _local_init(self): diff --git a/gramps/gui/editors/editmediaref.py b/gramps/gui/editors/editmediaref.py index 70cb55f98..8ccb5ac26 100644 --- a/gramps/gui/editors/editmediaref.py +++ b/gramps/gui/editors/editmediaref.py @@ -29,6 +29,7 @@ # #------------------------------------------------------------------------- import os +from copy import deepcopy #------------------------------------------------------------------------- # @@ -85,7 +86,7 @@ class EditMediaRef(EditReference): AddMedia(state, self.uistate, self.track, self.source, self._update_addmedia) else: - self.original = self.source.serialize() + self.original = deepcopy(self.source.serialize()) def _local_init(self): diff --git a/gramps/gui/editors/editplaceref.py b/gramps/gui/editors/editplaceref.py index a3fdf2042..ff7d9404f 100644 --- a/gramps/gui/editors/editplaceref.py +++ b/gramps/gui/editors/editplaceref.py @@ -18,7 +18,7 @@ # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. # - +from copy import deepcopy #------------------------------------------------------------------------- # # Gramps modules @@ -51,7 +51,7 @@ class EditPlaceRef(EditReference): def __init__(self, state, uistate, track, place, place_ref, update): EditReference.__init__(self, state, uistate, track, place, place_ref, update) - self.original = place.serialize() + self.original = deepcopy(place.serialize()) def _local_init(self): diff --git a/gramps/gui/editors/editreporef.py b/gramps/gui/editors/editreporef.py index 52ab10ccf..127a95ec1 100644 --- a/gramps/gui/editors/editreporef.py +++ b/gramps/gui/editors/editreporef.py @@ -24,7 +24,7 @@ # Python modules # #------------------------------------------------------------------------- - +from copy import deepcopy #------------------------------------------------------------------------- # # gramps modules @@ -51,7 +51,7 @@ class EditRepoRef(EditReference): EditReference.__init__(self, state, uistate, track, source, source_ref, update) - self.original = source.serialize() + self.original = deepcopy(source.serialize()) def _local_init(self):