Commit a9adcdb2 authored by Julien Muchembled's avatar Julien Muchembled

Fix bug that could generate wrong XML while exporting objects

MinimalMapping.__getitem__ can only accept real (sub)ids as parameter, otherwise
there would be conflicts between <minimal_oid_of_record_1>.<real_subid> and
<real_oid_of_record_2> if <minimal_oid_of_record_1> == <real_oid_of_record_2>

This is easy to reproduce if you export the whole portal at once.

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@40324 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 180c6adf
......@@ -160,11 +160,11 @@ def XMLrecord(oid, plen, p, id_mapping):
f=StringIO(p)
u=q(f)
id=u64(oid)
u.idprefix=str(id)+'.'
id = id_mapping[id]
old_aka = encodestring(oid)[:-1]
aka=encodestring(p64(long(id)))[:-1] # Rebuild oid based on mapped id
id_mapping.setConvertedAka(old_aka, aka)
u.idprefix=str(id)+'.'
p=u.load(id_mapping=id_mapping).__str__(4)
if f.tell() < plen:
p=p+u.load(id_mapping=id_mapping).__str__(4)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment