Commit 2d46ed0b authored by Jérome Perrin's avatar Jérome Perrin

calling getProperty(prop_name, evaluate=0) can fail, because it calls

a method named like "getPropName" which may not accept the evaluate argument.



git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@10026 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 828d34d7
......@@ -905,9 +905,13 @@ class CategoryTemplateItem(ObjectTemplateItem):
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():
if property not in ('id', 'uid'):
category.setProperty(property, obj.getProperty(property, evaluate=0))
for prop in obj.propertyIds():
if prop not in ('id', 'uid'):
try:
prop_value = obj.getProperty(prop, evaluate=0)
except:
prop_value = obj.getProperty(prop)
category.setProperty(prop, prop_value)
# import sub objects if there is
if len(subobjects_dict) > 0:
# get a jar
......@@ -944,9 +948,13 @@ class CategoryTemplateItem(ObjectTemplateItem):
subobjects_dict = self._backupObject('backup', trashbin, container_path, category_id)
container.manage_delObjects([category_id])
category = container.newContent(portal_type=obj.getPortalType(), id=category_id)
for property in obj.propertyIds():
if property not in ('id', 'uid'):
category.setProperty(property, obj.getProperty(property, evaluate=0))
for prop in obj.propertyIds():
if prop not in ('id', 'uid'):
try:
prop_value = obj.getProperty(prop, evaluate=0)
except:
prop_value = obj.getProperty(prop)
category.setProperty(prop, prop_value)
# import sub objects if there is
if len(subobjects_dict) > 0:
# get a jar
......
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