diff --git a/ChangeLog b/ChangeLog index bf911fc72..ec1246f77 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2007-09-29 Benny Malengier + * src/GrampsDb/_ReadXML.py: remove bug: no more creation of objects if bookmark is found with + handle that is not in database. This causes corruption of database! + * src/GrampsDb/_GrampsDbBase.py: person bookmarks do not work after save. Correct. Issue #1260 + 2007-09-28 James G. Sack * src/GrampsDb/_GrampsDbBase.py: 0001187: Runaway Gramps XML file sizes @@ -33,6 +38,7 @@ * src/ThumbNails.py: added rectangle parameter to thumbnail functions to specify the subsection * src/GrampsWidgets.py: added class MonitoredSpinButton * src/glade/gramps.glade: added preview pixmap of subsection thumbnail to change_description + Part 1 of thumbnail changes 2007-09-28 Zsolt Foldvari * src/docgen/CairoDoc.py (fontstyle_to_fontdescription): Fix deprecated diff --git a/src/GrampsDb/_GrampsXMLDB.py b/src/GrampsDb/_GrampsXMLDB.py index 7d326506e..09d249691 100644 --- a/src/GrampsDb/_GrampsXMLDB.py +++ b/src/GrampsDb/_GrampsXMLDB.py @@ -47,7 +47,6 @@ class GrampsXMLDB(GrampsInMemDB): def __init__(self, use_txn = True): """creates a new GrampsDB""" GrampsInMemDB.__init__(self) - self.bookmarks = GrampsDbBookmarks() def load(self, name, callback, mode="w"): @@ -67,7 +66,6 @@ class GrampsXMLDB(GrampsInMemDB): except OSError, IOError: return 1 - self.bookmarks.set(self.metadata.get('bookmarks',[])) self.db_is_open = True self.abort_possible = True return 1 diff --git a/src/GrampsDbUtils/_ReadXML.py b/src/GrampsDbUtils/_ReadXML.py index 28ac70285..25d8588a3 100644 --- a/src/GrampsDbUtils/_ReadXML.py +++ b/src/GrampsDbUtils/_ReadXML.py @@ -875,30 +875,33 @@ class GrampsParser(UpdateCallback): # This is new XML, so we are guaranteed to have a handle ref handle = attrs['hlink'].replace('_', '') + # Due to pre 2.2.9 bug, bookmarks might be handle of other object + # Make sure those are filtered out. + # Bookmarks are at end, so all handle must exist before we do bookmrks if target == 'person': - self.db.check_person_from_handle(handle, self.trans) - self.db.bookmarks.append(handle) + if self.db.find_person_from_handle(handle,self.trans) is not None: + self.db.bookmarks.append(handle) elif target == 'family': - self.db.check_family_from_handle(handle, self.trans) - self.db.family_bookmarks.append(handle) + if self.db.find_family_from_handle(handle,self.trans) is not None: + self.db.family_bookmarks.append(handle) elif target == 'event': - self.db.check_event_from_handle(handle, self.trans) - self.db.event_bookmarks.append(handle) + if self.db.find_event_from_handle(handle,self.trans) is not None: + self.db.event_bookmarks.append(handle) elif target == 'source': - self.db.check_source_from_handle(handle, self.trans) - self.db.source_bookmarks.append(handle) + if self.db.find_source_from_handle(handle,self.trans) is not None: + self.db.source_bookmarks.append(handle) elif target == 'place': - self.db.check_place_from_handle(handle, self.trans) - self.db.place_bookmarks.append(handle) + if self.db.find_place_from_handle(handle,self.trans) is not None: + self.db.place_bookmarks.append(handle) elif target == 'media': - self.db.check_object_from_handle(handle, self.trans) - self.db.media_bookmarks.append(handle) + if self.db.find_object_from_handle(handle,self.trans) is not None: + self.db.media_bookmarks.append(handle) elif target == 'repository': - self.db.check_repository_from_handle(handle, self.trans) - self.db.repo_bookmarks.append(handle) + if self.db.find_repository_from_handle(handle,self.trans) is not None: + self.db.repo_bookmarks.append(handle) elif target == 'note': - self.db.check_note_from_handle(handle, self.trans) - self.db.note_bookmarks.append(handle) + if self.db.find_note_from_handle(handle, self.trans) is not None: + self.db.note_bookmarks.append(handle) def start_format(self, attrs): number = int(attrs['number'])