Commit 27dc18d9 authored by Christophe Dumez's avatar Christophe Dumez

- should fix bug #357 : "Base categories lose their uid when updated"


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@9024 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 4a06098d
...@@ -892,10 +892,14 @@ class CategoryTemplateItem(ObjectTemplateItem): ...@@ -892,10 +892,14 @@ class CategoryTemplateItem(ObjectTemplateItem):
raise raise
container_ids = container.objectIds() container_ids = container.objectIds()
# Object already exists # Object already exists
object_uid = None
if category_id in container_ids: if category_id in container_ids:
object_uid = container[category_id].getUid()
subobjects_dict = self._backupObject(action, trashbin, container_path, category_id) subobjects_dict = self._backupObject(action, trashbin, container_path, category_id)
container.manage_delObjects([category_id]) container.manage_delObjects([category_id])
category = container.newContent(portal_type=obj.getPortalType(), id=category_id) category = container.newContent(portal_type=obj.getPortalType(), id=category_id)
if object_uid is not None:
category.setUid(object_uid)
for property in obj.propertyIds(): for property in obj.propertyIds():
if property not in ('id', 'uid'): if property not in ('id', 'uid'):
category.setProperty(property, obj.getProperty(property, evaluate=0)) category.setProperty(property, obj.getProperty(property, evaluate=0))
......
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