From 8fb88e466775cd7c50c869212fa34e366a91853e Mon Sep 17 00:00:00 2001
From: Julien Muchembled <jm@nexedi.com>
Date: Wed, 21 May 2008 09:55:31 +0000
Subject: [PATCH] Make r21048 safer when calling render_view methods.

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@21052 20353a03-c40f-0410-a6d1-a30d3c3de9de
---
 product/ERP5Form/DurationField.py      | 6 +++---
 product/ERP5Form/FormulatorPatch.py    | 6 +++---
 product/ERP5Form/ImageField.py         | 2 +-
 product/ERP5Form/MultiRelationField.py | 2 +-
 product/ERP5Form/ParallelListField.py  | 2 +-
 5 files changed, 9 insertions(+), 9 deletions(-)

diff --git a/product/ERP5Form/DurationField.py b/product/ERP5Form/DurationField.py
index 935c94d97a..89ff2c935d 100644
--- a/product/ERP5Form/DurationField.py
+++ b/product/ERP5Form/DurationField.py
@@ -74,10 +74,10 @@ class DurationWidget(FormulatorPatch.IntegerWidget):
         sub_value, value = divmod(value, convertion)
       
       sub_field_render_list.append(self.render_sub_field_view(
-                                        field,sub_value, REQUEST))
+                                     field, sub_value, REQUEST=REQUEST))
     # Render second
     sub_field_render_list.append(self.render_sub_field_view(
-                                      field, value, REQUEST))
+                                   field, value, REQUEST=REQUEST))
     return ':'.join(sub_field_render_list)
 
   def render(self, field, key, value, REQUEST):
@@ -102,7 +102,7 @@ class DurationWidget(FormulatorPatch.IntegerWidget):
     Render dynamically a subfield
     """
     return FormulatorPatch.IntegerFieldWidgetInstance.render_view(field, value,
-                                                                  REQUEST)
+                                                               REQUEST=REQUEST)
 
   def render_sub_field(self, field, key, value, REQUEST, keyword):
     """
diff --git a/product/ERP5Form/FormulatorPatch.py b/product/ERP5Form/FormulatorPatch.py
index 7c4f3f00f4..53981563e5 100644
--- a/product/ERP5Form/FormulatorPatch.py
+++ b/product/ERP5Form/FormulatorPatch.py
@@ -71,7 +71,7 @@ def Field_render(self, value=None, REQUEST=None, key=None):
 def Field_render_view(self, value=None, REQUEST=None):
     """Render value to be viewed.
     """
-    return self.widget.render_view(self, value, REQUEST)
+    return self.widget.render_view(self, value, REQUEST=REQUEST)
 
 def Field_render_sub_field(self, id, value=None, REQUEST=None, key=None):
     """Render a sub field, as part of complete rendering of widget in
@@ -103,7 +103,7 @@ def Field_render_helper(self, key, value, REQUEST):
     if self.get_value('hidden', REQUEST=REQUEST):
         return self.widget.render_hidden(self, key, value, REQUEST)
     elif (not self.get_value('editable', REQUEST=REQUEST)):
-        return self.widget.render_view(self, value, REQUEST)
+        return self.widget.render_view(self, value, REQUEST=REQUEST)
     else:
         return self.widget.render(self, key, value, REQUEST)
 
@@ -417,7 +417,7 @@ class IntegerWidget(TextWidget) :
       """Render a non-editable interger."""
       if isinstance(value, float):
           value = int(value)
-      return TextWidget.render_view(self, field, value, REQUEST)
+      return TextWidget.render_view(self, field, value, REQUEST=REQUEST)
 
 
 from Products.Formulator.StandardFields import IntegerField
diff --git a/product/ERP5Form/ImageField.py b/product/ERP5Form/ImageField.py
index 25fb5b6ca9..733b9ee172 100644
--- a/product/ERP5Form/ImageField.py
+++ b/product/ERP5Form/ImageField.py
@@ -69,7 +69,7 @@ class ImageFieldWidget(Widget.TextWidget):
     def render(self, field, key, value, REQUEST):
         """Render image field as a link to the image
         """
-        return self.render_view(field, value, REQUEST)
+        return self.render_view(field, value, REQUEST=REQUEST)
 
     def render_view(self, field, value, REQUEST=None):
         """Render image field as a link to the image
diff --git a/product/ERP5Form/MultiRelationField.py b/product/ERP5Form/MultiRelationField.py
index 7e765d95ce..d5b6282bde 100644
--- a/product/ERP5Form/MultiRelationField.py
+++ b/product/ERP5Form/MultiRelationField.py
@@ -294,7 +294,7 @@ class MultiRelationStringFieldWidget(Widget.LinesTextAreaWidget,
     XXX Improved rendering required
     """
     html_string = self.default_widget_rendering_instance.render_view(
-                                                      field, value, REQUEST)
+                                                 field, value, REQUEST=REQUEST)
     if REQUEST is None:
       REQUEST = get_request()
     relation_html_string = self.render_relation_link(field, value, REQUEST)
diff --git a/product/ERP5Form/ParallelListField.py b/product/ERP5Form/ParallelListField.py
index 7fa709af90..4dd9c4d1ad 100644
--- a/product/ERP5Form/ParallelListField.py
+++ b/product/ERP5Form/ParallelListField.py
@@ -140,7 +140,7 @@ class ParallelListWidget(Widget.MultiListWidget,
                 field.generate_subfield_key(sub_field_property_dict['key'],
                                             key=key),
                 sub_field_property_dict['value'],
-                REQUEST)
+                REQUEST=REQUEST)
       else:
         result = self.sub_widget[sub_field_property_dict['field_type']].render_view(
                 field,
-- 
2.30.9