From 4de60b0d02c6c9be157bbadf7e23d6a9c1467f8b Mon Sep 17 00:00:00 2001
From: Ivan Tyagov <ivan@nexedi.com>
Date: Thu, 12 Jun 2008 11:41:30 +0000
Subject: [PATCH] Ignore form fields passed in REQUESt to this method.

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@21522 20353a03-c40f-0410-a6d1-a30d3c3de9de
---
 .../WebSite_contributeContent.xml             | 21 ++++++++++++++++---
 bt5/erp5_web/bt/revision                      |  2 +-
 2 files changed, 19 insertions(+), 4 deletions(-)

diff --git a/bt5/erp5_web/SkinTemplateItem/portal_skins/erp5_web_widget_library/WebSite_contributeContent.xml b/bt5/erp5_web/SkinTemplateItem/portal_skins/erp5_web_widget_library/WebSite_contributeContent.xml
index e5046445b8..f045c1a511 100644
--- a/bt5/erp5_web/SkinTemplateItem/portal_skins/erp5_web_widget_library/WebSite_contributeContent.xml
+++ b/bt5/erp5_web/SkinTemplateItem/portal_skins/erp5_web_widget_library/WebSite_contributeContent.xml
@@ -139,9 +139,15 @@ else:\n
 \n
 # Change acquisition context of document, in order to get web section layout\n
 target = context.restrictedTraverse(target.getRelativeUrl())\n
-target.REQUEST.set(\'editable_mode\', editable_mode)\n
-target.REQUEST.set(\'portal_status_message\', msg)\n
-return target.view()\n
+target_request = target.REQUEST\n
+target_request.set(\'editable_mode\', editable_mode)\n
+target_request.set(\'portal_status_message\', msg)\n
+# clean up REQUEST as it is possible that this script is called\n
+# on an another Document in an edit view (then fields will be passed in REQUEST \n
+# overriding next form HTML generation in \'target.view()\' )\n
+for key in target_request.form.keys():\n
+  if key.startswith(\'field_my_\'):\n
+    del target_request.form[key]\n
 \n
 # XXX Do not use redirect, as it leeds to conflict error with convertion process\n
 # return target.Base_redirect(\'view\',\n
@@ -161,6 +167,12 @@ return target.view()\n
               <none/>
             </value>
         </item>
+        <item>
+            <key> <string>_owner</string> </key>
+            <value>
+              <none/>
+            </value>
+        </item>
         <item>
             <key> <string>_params</string> </key>
             <value> <string>contribute_file=None, contribute_classification=None, contribute_source_project=None, contribute_portal_type=None, **kw</string> </value>
@@ -218,6 +230,9 @@ return target.view()\n
                             <string>AttributeError</string>
                             <string>target</string>
                             <string>dict</string>
+                            <string>target_request</string>
+                            <string>_getiter_</string>
+                            <string>key</string>
                           </tuple>
                         </value>
                     </item>
diff --git a/bt5/erp5_web/bt/revision b/bt5/erp5_web/bt/revision
index e2756006da..0c1a9b6f06 100644
--- a/bt5/erp5_web/bt/revision
+++ b/bt5/erp5_web/bt/revision
@@ -1 +1 @@
-644
\ No newline at end of file
+645
\ No newline at end of file
-- 
2.30.9