Skip to content

Commit

Permalink
Import from XML working
Browse files Browse the repository at this point in the history
  • Loading branch information
dsblank committed Oct 29, 2024
1 parent 65d84c8 commit ae204b8
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
2 changes: 1 addition & 1 deletion gramps/gen/db/generic.py
Original file line number Diff line number Diff line change
Expand Up @@ -1943,7 +1943,7 @@ def commit_person(self, person, transaction, change_time=None):
old_data = self._commit_base(person, PERSON_KEY, transaction, change_time)

if old_data:
old_person = Person(old_data)
old_person = from_struct(old_data)
# Update gender statistics if necessary
if old_person.gender != person.gender or (
old_person.primary_name.first_name != person.primary_name.first_name
Expand Down
7 changes: 5 additions & 2 deletions gramps/plugins/importer/importxml.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@
Tag,
Url,
)
from gramps.gen.lib.serialize import from_struct
from gramps.gen.db import DbTxn

# from gramps.gen.db.write import CLASS_TO_KEY_MAP
Expand Down Expand Up @@ -839,7 +840,8 @@ class object of a primary object.
"tag": self.db.get_raw_tag_data,
}[target]
raw = get_raw_obj_data(handle)
prim_obj.unserialize(raw)
temp_obj = from_struct(raw)
prim_obj.set_object_state(temp_obj.get_object_state())
self.import_handles[orig_handle][target][INSTANTIATED] = True
return handle
elif handle in self.import_handles:
Expand Down Expand Up @@ -1000,7 +1002,8 @@ def inaugurate_id(self, id_, key, prim_obj):
handle = id2handle_map.get(gramps_id)
if handle:
raw = get_raw_obj_data(handle)
prim_obj.unserialize(raw)
temp_obj = from_struct(raw)
prim_obj.set_object_state(temp_obj.get_object_state())
else:
handle = create_id()
while has_handle_func(handle):
Expand Down

0 comments on commit ae204b8

Please sign in to comment.