[Erp5-report] r21736 - in /erp5/trunk/products/ERP5/bootstrap/erp5_core: SkinTemplateItem/p...

nobody at svn.erp5.org nobody at svn.erp5.org
Mon Jun 23 11:32:44 CEST 2008


Author: jerome
Date: Mon Jun 23 11:32:41 2008
New Revision: 21736

URL: http://svn.erp5.org?rev=21736&view=rev
Log:
File.index_html must be called after setting headers, otherwise the filename is sometimes "Base_download"
Problem: if an error happens during index_html, content disposition will be set, so the browser will ask to save a file containing html error text

Modified:
    erp5/trunk/products/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_core/Base_download.xml
    erp5/trunk/products/ERP5/bootstrap/erp5_core/bt/revision

Modified: erp5/trunk/products/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_core/Base_download.xml
URL: http://svn.erp5.org/erp5/trunk/products/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_core/Base_download.xml?rev=21736&r1=21735&r2=21736&view=diff
==============================================================================
--- erp5/trunk/products/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_core/Base_download.xml (original)
+++ erp5/trunk/products/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_core/Base_download.xml Mon Jun 23 11:32:41 2008
@@ -70,12 +70,6 @@
 \n
 from zExceptions import Unauthorized\n
 \n
-try:\n
-  result = context.index_html(request, response)\n
-except Unauthorized:\n
-  msg = context.Base_translateString("You don\'t have enough permission for converting this document.")\n
-  return context.Base_redirect(keep_items=dict(portal_status_message=msg))\n
-\n
 if hasattr(context,\'getContentType\'):\n
   response.setHeader(\'Content-type\', context.getContentType())\n
 else:\n
@@ -83,6 +77,12 @@
 \n
 file_name = context.getSourceReference() or context.getTitle() or context.getId()\n
 response.setHeader(\'Content-disposition\', \'attachment; filename="%s"\' % file_name)\n
+\n
+try:\n
+  result = context.index_html(request, response)\n
+except Unauthorized:\n
+  msg = context.Base_translateString("You don\'t have enough permission for converting this document.")\n
+  return context.Base_redirect(keep_items=dict(portal_status_message=msg))\n
 \n
 return result\n
 </string> </value>
@@ -95,6 +95,12 @@
         </item>
         <item>
             <key> <string>_filepath</string> </key>
+            <value>
+              <none/>
+            </value>
+        </item>
+        <item>
+            <key> <string>_owner</string> </key>
             <value>
               <none/>
             </value>
@@ -133,12 +139,12 @@
                             <string>response</string>
                             <string>zExceptions</string>
                             <string>Unauthorized</string>
+                            <string>hasattr</string>
                             <string>context</string>
+                            <string>file_name</string>
                             <string>result</string>
                             <string>msg</string>
                             <string>dict</string>
-                            <string>hasattr</string>
-                            <string>file_name</string>
                           </tuple>
                         </value>
                     </item>

Modified: erp5/trunk/products/ERP5/bootstrap/erp5_core/bt/revision
URL: http://svn.erp5.org/erp5/trunk/products/ERP5/bootstrap/erp5_core/bt/revision?rev=21736&r1=21735&r2=21736&view=diff
==============================================================================
--- erp5/trunk/products/ERP5/bootstrap/erp5_core/bt/revision (original)
+++ erp5/trunk/products/ERP5/bootstrap/erp5_core/bt/revision Mon Jun 23 11:32:41 2008
@@ -1,1 +1,1 @@
-854
+855




More information about the Erp5-report mailing list