From 44d84ef6b3d0c9c57bca23a0e7f6e13d0024dd32 Mon Sep 17 00:00:00 2001
From: Ivan Tyagov <ivan@nexedi.com>
Date: Thu, 14 Jun 2007 13:25:21 +0000
Subject: [PATCH] Do not pass dialog argument to newContent API of
 portal_contributions. Pass only what's really needed.

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@14827 20353a03-c40f-0410-a6d1-a30d3c3de9de
---
 .../erp5_dms/ContributionTool_newContent.xml  | 22 +++++--------------
 bt5/erp5_dms/bt/revision                      |  2 +-
 2 files changed, 7 insertions(+), 17 deletions(-)

diff --git a/bt5/erp5_dms/SkinTemplateItem/portal_skins/erp5_dms/ContributionTool_newContent.xml b/bt5/erp5_dms/SkinTemplateItem/portal_skins/erp5_dms/ContributionTool_newContent.xml
index 54b99f0fbd..72f406ed8f 100644
--- a/bt5/erp5_dms/SkinTemplateItem/portal_skins/erp5_dms/ContributionTool_newContent.xml
+++ b/bt5/erp5_dms/SkinTemplateItem/portal_skins/erp5_dms/ContributionTool_newContent.xml
@@ -71,24 +71,15 @@
             <value> <string>"""\n
   Processes request of ContributionTool_viewContributeFileDialog\n
   does what is necessary and calls portal_contributions.newContent\n
-  redirects to what is returned\n
+  redirects to what is returned.\n
 """\n
 \n
 translateString = context.Base_translateString\n
+portal_type = kw.get(\'portal_type\', None)\n
 \n
-# clean up kw from file field otherwise \n
-# ZODB raises an exception when committing transaction\n
-kw.pop(\'field_your_file\', None)\n
-# remove Base_callDialogMethod arg, otherwise it is set on context\n
-# and then we can\'t execute any workflow transition\n
-kw.pop(\'Base_callDialogMethod\', None)\n
-\n
-if kw[\'portal_type\'] == \'\':\n
-  # we don\'t want to set portal_type to \'\' :)\n
-  kw.pop(\'portal_type\', None)\n
-\n
-# ingest file\n
-doc = context.portal_contributions.newContent(file=file, **kw)\n
+# ingest file (asynchronously)\n
+doc = context.portal_contributions.newContent(file = file,\n
+                                              portal_type = portal_type)\n
 \n
 msg = translateString("${portal_type} created successfully.",\n
                        mapping = {\'portal_type\':doc.getPortalType()})\n
@@ -149,8 +140,7 @@ return context.Base_redirect(\'view\', keep_items = {\'portal_status_message\':m
                             <string>context</string>
                             <string>translateString</string>
                             <string>None</string>
-                            <string>_getitem_</string>
-                            <string>_apply_</string>
+                            <string>portal_type</string>
                             <string>doc</string>
                             <string>msg</string>
                           </tuple>
diff --git a/bt5/erp5_dms/bt/revision b/bt5/erp5_dms/bt/revision
index 876cce90b1..d02412a497 100644
--- a/bt5/erp5_dms/bt/revision
+++ b/bt5/erp5_dms/bt/revision
@@ -1 +1 @@
-654
\ No newline at end of file
+655
\ No newline at end of file
-- 
2.30.9