From ca929cfb2f39cf03990d7393d57a7d67e5f83cf1 Mon Sep 17 00:00:00 2001 From: Vassilii Khachaturov Date: Thu, 29 Aug 2013 16:20:29 +0000 Subject: [PATCH] 6960: error merging citations merge_ref_test still fails... svn: r22937 --- gramps/gen/merge/mergecitationquery.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/gramps/gen/merge/mergecitationquery.py b/gramps/gen/merge/mergecitationquery.py index be54ce91b..fba082e8b 100644 --- a/gramps/gen/merge/mergecitationquery.py +++ b/gramps/gen/merge/mergecitationquery.py @@ -30,7 +30,8 @@ Provide merge capabilities for citations. # Gramps modules # #------------------------------------------------------------------------- -from ..lib import (Person, Family, Event, Place, MediaObject, Repository) +from ..lib import (Person, Family, Event, Place, + MediaObject, Repository, Citation) from ..db import DbTxn from ..const import GRAMPS_LOCALE as glocale _ = glocale.translation.sgettext @@ -94,6 +95,12 @@ class MergeCitationQuery(object): repository.replace_citation_references(old_handle, new_handle) self.database.commit_repository(repository, trans) + elif class_name == Citation.__name__: + citation = self.database.get_citation_from_handle(handle) + assert(citation.has_citation_reference(old_handle)) + citation.replace_citation_references(old_handle, + new_handle) + self.database.commit_citation(citation, trans) else: raise MergeError("Encounter an object of type %s that has " "a citation reference." % class_name)