Ticket #5504 (closed Bug: fixed)
OpenDocument files shown as garbage text
|Reported by:||stainsby||Owned by:||alecm|
When I add an OpenOffice Write (.odt) file, the MIME type is detected correctly as "File type application/vnd.oasis.opendocument.text". However, the page template decides to try to render the contents under "File contents", with garbage text as the result.
The cause is clear: in portal_skins/plone_content/file_view, the decision to display the contents of a file is made by searching for the substring 'text' in the MIME type (OMG!). A quick fix can be hacked in by replacing:
tal:condition="python:test(not content_type.startswith('application/vnd.oasis.opendocument.') and (content_type.find('text')>-1), 1,0)"
but that is clearly unsatisfactory for general use.
A possible fix: The mimetype_registry has a boolean "binary' property for each MIME type. I suggest that this should be used.
- Status changed from new to closed
- Resolution set to fixed