Commit b0582536 authored by Nicolas Delaby's avatar Nicolas Delaby

filename argument is understood as original filename by portal_transforms.

Give original filename instead of converted filename, to not confuse transforms behind
portal_transforms.



git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@44584 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent adcc000d
......@@ -247,7 +247,7 @@ class Image(TextConvertableMixin, File, OFSImage):
portal_transforms = portal.portal_transforms
result = portal_transforms.convertToData(mime_type, content,
object=self, context=self,
filename=self.getTitleOrId(),
filename=self.getFilename(),
mimetype=src_mimetype)
if result is None:
# portal_transforms fails to convert.
......
......@@ -123,7 +123,7 @@ class PDFDocument(Image):
return ''
mime_type = 'text/plain'
portal_transforms = self.getPortalObject().portal_transforms
filename = self.getStandardFilename(format='txt')
filename = self.getFilename()
result = portal_transforms.convertToData(mime_type, str(self.getData()),
context=self, filename=filename,
mimetype=self.getContentType())
......
......@@ -155,7 +155,7 @@ class TextDocument(CachedConvertableMixin, BaseConvertableFileMixin,
kw['charset'] = convert_kw['encoding'] = charset
if not self.hasConversion(**kw):
portal_transforms = portal.portal_transforms
filename = self.getStandardFilename(format=format)
filename = self.getFilename()
if mime_type == 'text/html':
mime_type = 'text/x-html-safe'
result = portal_transforms.convertToData(mime_type, text_content,
......
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