Commit 5857ae8f authored by Yoshinori Okuji's avatar Yoshinori Okuji

Fix bugs in SitePropertyTemplateItem.


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@2252 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 46576c52
...@@ -565,10 +565,16 @@ class SitePropertyTemplateItem(BaseTemplateItem): ...@@ -565,10 +565,16 @@ class SitePropertyTemplateItem(BaseTemplateItem):
BaseTemplateItem.build(self, context, **kw) BaseTemplateItem.build(self, context, **kw)
p = context.getPortalObject() p = context.getPortalObject()
for id in self._archive.keys(): for id in self._archive.keys():
property = p.getProperty(id) for property in p.propertyMap():
if property['id'] == id:
property['value'] = p.getProperty(id)
break
else:
property = None
if property is None: if property is None:
raise NotFound, 'the property %s is not found' % id raise NotFound, 'the property %s is not found' % id
self._archive[id] = property.copy() #LOG('SitePropertyTemplateItem build', 0, 'property = %r' % (property,))
self._archive[id] = property
def install(self, context, **kw): def install(self, context, **kw):
BaseTemplateItem.install(self, context, **kw) BaseTemplateItem.install(self, context, **kw)
...@@ -577,7 +583,7 @@ class SitePropertyTemplateItem(BaseTemplateItem): ...@@ -577,7 +583,7 @@ class SitePropertyTemplateItem(BaseTemplateItem):
if p.hasProperty(id): if p.hasProperty(id):
# Too much??? # Too much???
raise TemplateConflictError, 'the property %s already exists' % id raise TemplateConflictError, 'the property %s already exists' % id
object._setProperty(id, pi['value'], type=pi['type']) object._setProperty(id, property['value'], type=property['type'])
def uninstall(self, context, **kw): def uninstall(self, context, **kw):
p = context.getPortalObject() p = context.getPortalObject()
......
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