[Erp5-report] r44046 jerome - in /erp5/trunk/products/ERP5/bootstrap/erp5_xhtml_style: Skin...

nobody at svn.erp5.org nobody at svn.erp5.org
Tue Mar 8 12:06:36 CET 2011


Author: jerome
Date: Tue Mar  8 12:06:36 2011
New Revision: 44046

URL: http://svn.erp5.org?rev=44046&view=rev
Log:
truncate portal status message if it seems too long

Modified:
    erp5/trunk/products/ERP5/bootstrap/erp5_xhtml_style/SkinTemplateItem/portal_skins/erp5_xhtml_style/Workflow_statusModify.xml
    erp5/trunk/products/ERP5/bootstrap/erp5_xhtml_style/bt/revision

Modified: erp5/trunk/products/ERP5/bootstrap/erp5_xhtml_style/SkinTemplateItem/portal_skins/erp5_xhtml_style/Workflow_statusModify.xml
URL: http://svn.erp5.org/erp5/trunk/products/ERP5/bootstrap/erp5_xhtml_style/SkinTemplateItem/portal_skins/erp5_xhtml_style/Workflow_statusModify.xml?rev=44046&r1=44045&r2=44046&view=diff
==============================================================================
--- erp5/trunk/products/ERP5/bootstrap/erp5_xhtml_style/SkinTemplateItem/portal_skins/erp5_xhtml_style/Workflow_statusModify.xml [utf8] (original)
+++ erp5/trunk/products/ERP5/bootstrap/erp5_xhtml_style/SkinTemplateItem/portal_skins/erp5_xhtml_style/Workflow_statusModify.xml [utf8] Tue Mar  8 12:06:36 2011
@@ -50,9 +50,12 @@
         </item>
         <item>
             <key> <string>_body</string> </key>
-            <value> <string>from Products.Formulator.Errors import FormValidationError\n
+            <value> <string encoding="cdata"><![CDATA[
+
+from Products.Formulator.Errors import FormValidationError\n
 from Products.DCWorkflow.DCWorkflow import ValidationFailed\n
 from Products.ERP5Type.Message import translateString\n
+from Products.ERP5Type.Log import log\n
 portal = context.getPortalObject()\n
 request=context.REQUEST\n
 \n
@@ -116,6 +119,10 @@ except ValidationFailed, error_message:\
       message = str(message)\n
   else:\n
     message = str(error_message)\n
+  if len(message) > 2000: # too long message will generate a too long URI\n
+                          # that would become an error.\n
+    log("Status message has been truncated")\n
+    message = "%s ..." % message[:(2000 - 4)]\n
   return context.Base_redirect(form_id,\n
                   keep_items={\'portal_status_message\': message}, **kw)\n
 \n
@@ -131,7 +138,9 @@ else:\n
 \n
 return redirect_document.Base_redirect(form_id,\n
                 keep_items={\'portal_status_message\': portal_status_message})\n
-</string> </value>
+
+
+]]></string> </value>
         </item>
         <item>
             <key> <string>_params</string> </key>

Modified: erp5/trunk/products/ERP5/bootstrap/erp5_xhtml_style/bt/revision
URL: http://svn.erp5.org/erp5/trunk/products/ERP5/bootstrap/erp5_xhtml_style/bt/revision?rev=44046&r1=44045&r2=44046&view=diff
==============================================================================
--- erp5/trunk/products/ERP5/bootstrap/erp5_xhtml_style/bt/revision [utf8] (original)
+++ erp5/trunk/products/ERP5/bootstrap/erp5_xhtml_style/bt/revision [utf8] Tue Mar  8 12:06:36 2011
@@ -1 +1 @@
-1067
\ No newline at end of file
+1068
\ No newline at end of file



More information about the Erp5-report mailing list