From 87e685aa23f97c5e898c148bd628c85c71e66418 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?J=C3=A9rome=20Perrin?= <jerome@nexedi.com>
Date: Tue, 17 Mar 2009 09:57:50 +0000
Subject: [PATCH] revert 26047 and explain the reason of clearing request.form
 here

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@26064 20353a03-c40f-0410-a6d1-a30d3c3de9de
---
 product/ERP5Form/Report.py | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/product/ERP5Form/Report.py b/product/ERP5Form/Report.py
index 1fb3d4740c..43108a61c0 100644
--- a/product/ERP5Form/Report.py
+++ b/product/ERP5Form/Report.py
@@ -342,6 +342,18 @@ class ReportSection:
 
     self.saved_request_form = REQUEST.form
 
+    # REQUEST.form is cleared here, because when rendering a report section
+    # with a listbox, listbox gets parameters from request.form and edits
+    # selection with those parameters, so if you happen to pass explicitly
+    # selection params that have the same name as some request parameters (some
+    # dialog fields) but different values, listbox would not use your explicit
+    # parameters, but the ones from REQUEST.form.
+    # As a result, request parameters are not available inside a report
+    # section, and if one needs to access report parameters from inside a
+    # report section, he have to store them in selection parameters in the
+    # report method (the method returning the list of ReportSection)
+    REQUEST.form = {}
+
   security.declarePublic('popReport')
   def popReport(self, context, render_prefix=None):
     REQUEST = get_request()
-- 
2.30.9