Commit 77aeab78 authored by Nicolas Delaby's avatar Nicolas Delaby

Replace convertTo by convertToData which return always str objects.

Add new parameter usefull for oood chains
Enhance log message

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@21152 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 6a2bad43
......@@ -163,14 +163,14 @@ class TextDocument(Document, TextContent):
text_content = self.getTextContent()
if text_content is not None:
portal_transforms = getToolByName(self, 'portal_transforms')
result = portal_transforms.convertTo(mime_type,
text_content,
object=self,
result = portal_transforms.convertToData(mime_type, text_content,
object=self, context=self,
filename=self.title_or_id(),
mimetype=src_mimetype)
if result is None:
# portal_transforms fails to convert.
LOG('TextDocument.convert', WARNING,
'portal_transforms failed to convert to text: %r' % self)
'portal_transforms failed to convert to %s: %r' % (mime_type, self))
result = ''
return mime_type, result
else:
......
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