From 683627b3be35bf2bfeb649041af2aedb659fac9f Mon Sep 17 00:00:00 2001
From: Yusei Tahara <yusei@nexedi.com>
Date: Fri, 24 Oct 2008 13:19:13 +0000
Subject: [PATCH] 2008-10-24 yusei * Convert return value of render_pdf to
 string explicitly. It might return non-string value.

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@24315 20353a03-c40f-0410-a6d1-a30d3c3de9de
---
 .../portal_skins/erp5_odt_style/form_view.xml               | 6 +++---
 bt5/erp5_odt_style/bt/change_log                            | 5 ++++-
 bt5/erp5_odt_style/bt/revision                              | 2 +-
 3 files changed, 8 insertions(+), 5 deletions(-)

diff --git a/bt5/erp5_odt_style/SkinTemplateItem/portal_skins/erp5_odt_style/form_view.xml b/bt5/erp5_odt_style/SkinTemplateItem/portal_skins/erp5_odt_style/form_view.xml
index da11ec368f..c95b470868 100644
--- a/bt5/erp5_odt_style/SkinTemplateItem/portal_skins/erp5_odt_style/form_view.xml
+++ b/bt5/erp5_odt_style/SkinTemplateItem/portal_skins/erp5_odt_style/form_view.xml
@@ -242,7 +242,7 @@ bWxQSwUGAAAAAAIAAgCeAAAAhwwAAAAA</string> </value>
                           <tal:block tal:condition="python: field_type not in (\'ImageField\',\'OOoChart\' )">\n
                             <text:p tal:condition="python: not(same_type(value,[]) or same_type(value,()))"\n
                                     text:style-name=\'field-content\'\n
-                                    tal:content="structure python: field.render_pdf(value).replace(\'&amp;\', \'&amp;amp;\').replace(\'&gt;\', \'&amp;gt;\').replace(\'&lt;\', \'&amp;lt;\').replace(\'\\n\', \'&lt;text:line-break/&gt;\')"/>\n
+                                    tal:content="structure python:str(field.render_pdf(value)).replace(\'&amp;\', \'&amp;amp;\').replace(\'&gt;\', \'&amp;gt;\').replace(\'&lt;\', \'&amp;lt;\').replace(\'\\n\', \'&lt;text:line-break/&gt;\')"/>\n
                             <tal:block tal:condition="python:same_type(value,[]) or same_type(value,())"\n
                                         tal:repeat="item value">\n
                               <text:p text:style-name=\'field-content\'\n
@@ -385,11 +385,11 @@ bWxQSwUGAAAAAAIAAgCeAAAAhwwAAAAA</string> </value>
                     </tal:block>\n
                     <tal:block tal:condition="python: field_type in (\'EditorField\',) and field.get_value(\'text_editor\')==\'text_area\'">\n
                       <text:p text:style-name=\'field-content-center\'\n
-                  tal:content="structure python: field.render_pdf(value).replace(\'&amp;\', \'&amp;amp;\').replace(\'&gt;\', \'&amp;gt;\').replace(\'&lt;\', \'&amp;lt;\').replace(\'\\n\', \'&lt;text:line-break/&gt;\')"/>\n
+                  tal:content="structure python: str(field.render_pdf(value)).replace(\'&amp;\', \'&amp;amp;\').replace(\'&gt;\', \'&amp;gt;\').replace(\'&lt;\', \'&amp;lt;\').replace(\'\\n\', \'&lt;text:line-break/&gt;\')"/>\n
                     </tal:block>\n
                     <tal:block tal:condition="python: field_type!=\'EditorField\'">\n
                       <text:p text:style-name=\'field-content-center\'\n
-                              tal:content="structure python: field.render_pdf(value).replace(\'&amp;\', \'&amp;amp;\').replace(\'&gt;\', \'&amp;gt;\').replace(\'&lt;\', \'&amp;lt;\').replace(\'\\n\', \'&lt;text:line-break/&gt;\')"/>\n
+                              tal:content="structure python: str(field.render_pdf(value)).replace(\'&amp;\', \'&amp;amp;\').replace(\'&gt;\', \'&amp;gt;\').replace(\'&lt;\', \'&amp;lt;\').replace(\'\\n\', \'&lt;text:line-break/&gt;\')"/>\n
                     </tal:block>\n
                   </tal:block>\n
                   <tal:block tal:condition="python: value is None">\n
diff --git a/bt5/erp5_odt_style/bt/change_log b/bt5/erp5_odt_style/bt/change_log
index 01068b1d1e..8c8e1e6532 100644
--- a/bt5/erp5_odt_style/bt/change_log
+++ b/bt5/erp5_odt_style/bt/change_log
@@ -1,3 +1,6 @@
+2008-10-24 yusei
+* Convert return value of render_pdf to string explicitly. It might return non-string value.
+
 2008-10-14 yusei
 * Start to develop version 5.3.
 
@@ -21,4 +24,4 @@ Image support improvement
 Add macros for deferred rendering in report_view
 
 2007-08-24 Ibou NDIAYE
-Initial revision
+Initial revision
\ No newline at end of file
diff --git a/bt5/erp5_odt_style/bt/revision b/bt5/erp5_odt_style/bt/revision
index b2412e34df..4e9e288487 100644
--- a/bt5/erp5_odt_style/bt/revision
+++ b/bt5/erp5_odt_style/bt/revision
@@ -1 +1 @@
-62
\ No newline at end of file
+63
\ No newline at end of file
-- 
2.30.9