Commit 2d94e28c authored by Nicolas Delaby's avatar Nicolas Delaby

Move the return BaiseTool.newContent for temporary objects later in order

to initialise some variables like portal_type and filename to ease
the creation of temporary object. Without this patch, the first portal_type
of allowed_content_type of portal_contribution is used.



git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@34888 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent fc470988
...@@ -135,10 +135,6 @@ class ContributionTool(BaseTool): ...@@ -135,10 +135,6 @@ class ContributionTool(BaseTool):
# we can pass file as parameter to ZPublisher # we can pass file as parameter to ZPublisher
# whenever we ingest email # whenever we ingest email
kw['data'] = data kw['data'] = data
# Temp objects use the standard newContent from Folder
if temp_object:
# For temp_object creation, use the standard method
return BaseTool.newContent(self, id=id, portal_type=portal_type, temp_object=1, **kw)
document = None document = None
...@@ -226,6 +222,11 @@ class ContributionTool(BaseTool): ...@@ -226,6 +222,11 @@ class ContributionTool(BaseTool):
document.edit(file=kw['file']) document.edit(file=kw['file'])
return document return document
# Temp objects use the standard newContent from Folder
if temp_object:
# For temp_object creation, use the standard method
return BaseTool.newContent(self, id=id, portal_type=portal_type, temp_object=1, **kw)
# Then put the file inside ourselves for a short while # Then put the file inside ourselves for a short while
if container_path is not None: if container_path is not None:
container = self.getPortalObject().restrictedTraverse(container_path) container = self.getPortalObject().restrictedTraverse(container_path)
......
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