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)