[Erp5-report] r26073 - /erp5/trunk/products/ERP5Form/Report.py

nobody at svn.erp5.org nobody at svn.erp5.org
Tue Mar 17 14:34:03 CET 2009


Author: jerome
Date: Tue Mar 17 14:34:00 2009
New Revision: 26073

URL: http://svn.erp5.org?rev=26073&view=rev
Log:
instead of cleaning all request.form, just remove parameters that overlaps with
explicit selection params

Modified:
    erp5/trunk/products/ERP5Form/Report.py

Modified: erp5/trunk/products/ERP5Form/Report.py
URL: http://svn.erp5.org/erp5/trunk/products/ERP5Form/Report.py?rev=26073&r1=26072&r2=26073&view=diff
==============================================================================
--- erp5/trunk/products/ERP5Form/Report.py [utf8] (original)
+++ erp5/trunk/products/ERP5Form/Report.py [utf8] Tue Mar 17 14:34:00 2009
@@ -342,17 +342,15 @@
 
     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 = {}
+    # 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, so we remove eventual request parameters that have the same
+    # name of selections parameters passed explicitly.
+    for selection_parameter in (self.selection_params or ()):
+      REQUEST.form.pop(selection_parameter, None)
 
   security.declarePublic('popReport')
   def popReport(self, context, render_prefix=None):




More information about the Erp5-report mailing list