[xwiki-notifications] r6600 - xwiki-platform/core/branches/xwiki-core-1.1/src/main/java/com/xpn/xwiki/plugin/fileupload

ludovic (SVN) notifications at xwiki.org
Wed Jan 2 19:28:01 CET 2008


Author: ludovic
Date: 2008-01-02 19:28:01 +0100 (Wed, 02 Jan 2008)
New Revision: 6600

Modified:
   xwiki-platform/core/branches/xwiki-core-1.1/src/main/java/com/xpn/xwiki/plugin/fileupload/FileUploadPlugin.java
Log:
FileUploadPlugin should not call cleanFileList in endRendering

Modified: xwiki-platform/core/branches/xwiki-core-1.1/src/main/java/com/xpn/xwiki/plugin/fileupload/FileUploadPlugin.java
===================================================================
--- xwiki-platform/core/branches/xwiki-core-1.1/src/main/java/com/xpn/xwiki/plugin/fileupload/FileUploadPlugin.java	2008-01-02 17:11:21 UTC (rev 6599)
+++ xwiki-platform/core/branches/xwiki-core-1.1/src/main/java/com/xpn/xwiki/plugin/fileupload/FileUploadPlugin.java	2008-01-02 18:28:01 UTC (rev 6600)
@@ -152,7 +152,8 @@
      */
     public void endRendering(XWikiContext context)
     {
-        cleanFileList(context);
+        // we used to call cleanFileList here but we should not anymore as endRendering is called to many times
+        // and empties the file upload list. This is handled by XWikiAction and XWikiPortlet which clean up lists in a finally block
     }
 
     /**
@@ -213,6 +214,13 @@
         XWikiContext context) throws XWikiException
     {
         LOG.debug("Loading uploaded files");
+        // If we already have a file list then loadFileList was already called
+        // Continuing would empty the list.. We need to stop.
+        if (context.get(FILE_LIST_KEY)!=null) {
+            LOG.debug("Called loadFileList twice");
+            return;
+        }
+
         // Get the FileUpload Data
         DiskFileItemFactory factory = new DiskFileItemFactory();
         factory.setSizeThreshold(uploadSizeThreashold);



More information about the notifications mailing list