From 96b45d98d648b6b0a5398e828098828cb9e406f6 Mon Sep 17 00:00:00 2001
From: Vincent Pelletier <vincent@nexedi.com>
Date: Wed, 14 May 2008 05:44:21 +0000
Subject: [PATCH] Provided values are not always strings (int, Messages, ...)
 but they will anyway get cast into strings in Formulator's render_element. So
 always cast before escaping.

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

diff --git a/product/ERP5Form/FormulatorPatch.py b/product/ERP5Form/FormulatorPatch.py
index 7597e09578..4d7fe67510 100644
--- a/product/ERP5Form/FormulatorPatch.py
+++ b/product/ERP5Form/FormulatorPatch.py
@@ -611,14 +611,14 @@ def SingleItemsWidget_render_items(self, field, key, value, REQUEST):
 
 
       if item_value == value and not selected_found:
-          rendered_item = self.render_selected_item(escape(item_text),
+          rendered_item = self.render_selected_item(escape(str(item_text)),
                                                     item_value,
                                                     key,
                                                     css_class,
                                                     extra_item)
           selected_found = 1
       else:
-          rendered_item = self.render_item(escape(item_text),
+          rendered_item = self.render_item(escape(str(item_text)),
                                             item_value,
                                             key,
                                             css_class,
-- 
2.30.9