Commit 6cac0f5f authored by Julien Muchembled's avatar Julien Muchembled

BusinessTemplate: fix detection of migrated Documents/Extensions

parent dccbb3b8
...@@ -4000,16 +4000,12 @@ class DocumentTemplateItem(FilesystemToZodbTemplateItem): ...@@ -4000,16 +4000,12 @@ class DocumentTemplateItem(FilesystemToZodbTemplateItem):
if not self._is_already_migrated(self._archive.keys()): if not self._is_already_migrated(self._archive.keys()):
document_id_list = self.getTemplateIdList() document_id_list = self.getTemplateIdList()
if document_id_list[0] not in getattr(context.getPortalObject(),
try: 'portal_components', ()):
context.getPortalObject().unrestrictedTraverse(
'portal_components/' + document_id_list[0])
except (IndexError, KeyError):
return FilesystemDocumentTemplateItem.build(self, context, **kw) return FilesystemDocumentTemplateItem.build(self, context, **kw)
else: self._archive.clear()
self._archive.clear() for name in document_id_list:
for name in document_id_list: self._archive['portal_components/' + name] = None
self._archive['portal_components/' + name] = None
return ObjectTemplateItem.build(self, context, **kw) return ObjectTemplateItem.build(self, context, **kw)
......
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