[Erp5-report] r40324 jm - /erp5/trunk/products/ERP5Type/patches/XMLExportImport.py

nobody at svn.erp5.org nobody at svn.erp5.org
Wed Nov 17 11:10:00 CET 2010


Author: jm
Date: Wed Nov 17 11:10:00 2010
New Revision: 40324

URL: http://svn.erp5.org?rev=40324&view=rev
Log:
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.

Modified:
    erp5/trunk/products/ERP5Type/patches/XMLExportImport.py

Modified: erp5/trunk/products/ERP5Type/patches/XMLExportImport.py
URL: http://svn.erp5.org/erp5/trunk/products/ERP5Type/patches/XMLExportImport.py?rev=40324&r1=40323&r2=40324&view=diff
==============================================================================
--- erp5/trunk/products/ERP5Type/patches/XMLExportImport.py [utf8] (original)
+++ erp5/trunk/products/ERP5Type/patches/XMLExportImport.py [utf8] Wed Nov 17 11:10:00 2010
@@ -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)




More information about the Erp5-report mailing list