Commit 4c4e26bf authored by Jérome Perrin's avatar Jérome Perrin

base/conversion: setContentType before converting to base format

some conversion (TextDocument) depend on the content type, so it's
necessary to first update the content type before trying to convert to
base format
parent a453716c
...@@ -10,8 +10,9 @@ ...@@ -10,8 +10,9 @@
<key> <string>categories</string> </key> <key> <string>categories</string> </key>
<value> <value>
<tuple> <tuple>
<string>after_script/portal_workflow/document_conversion_interaction_workflow/script_Document_convertToBaseFormat</string> <string>after_script/portal_workflow/document_conversion_interaction_workflow/script_Document_guessMimeType</string>
<string>after_script/portal_workflow/document_conversion_interaction_workflow/script_Document_upload</string> <string>after_script/portal_workflow/document_conversion_interaction_workflow/script_Document_upload</string>
<string>after_script/portal_workflow/document_conversion_interaction_workflow/script_Document_convertToBaseFormat</string>
</tuple> </tuple>
</value> </value>
</item> </item>
......
...@@ -22,7 +22,7 @@ ...@@ -22,7 +22,7 @@
</item> </item>
<item> <item>
<key> <string>guard_expression</string> </key> <key> <string>guard_expression</string> </key>
<value> <string>here/hasFilename</string> </value> <value> <string>not: here/isSupportBaseDataConversion</string> </value>
</item> </item>
<item> <item>
<key> <string>guard_group</string> </key> <key> <string>guard_group</string> </key>
......
...@@ -2,7 +2,7 @@ document = state_change['object'] ...@@ -2,7 +2,7 @@ document = state_change['object']
portal = document.getPortalObject() portal = document.getPortalObject()
filename = document.getFilename() filename = document.getFilename()
content_type = portal.mimetypes_registry.lookupExtension(filename) if filename:
content_type = portal.mimetypes_registry.lookupExtension(filename)
if content_type is not None: if content_type is not None:
document.setContentType(str(content_type)) document.setContentType(str(content_type))
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