Author: ludovic
Date: 2008-01-02 19:29:14 +0100 (Wed, 02 Jan 2008)
New Revision: 6601
Modified:
xwiki-platform/core/trunk/xwiki-core/src/main/java/com/xpn/xwiki/plugin/fileupload/FileUploadPlugin.java
Log:
FileUploadPlugin should not call cleanFileList in endRendering
Modified:
xwiki-platform/core/trunk/xwiki-core/src/main/java/com/xpn/xwiki/plugin/fileupload/FileUploadPlugin.java
===================================================================
---
xwiki-platform/core/trunk/xwiki-core/src/main/java/com/xpn/xwiki/plugin/fileupload/FileUploadPlugin.java
2008-01-02 18:28:01 UTC (rev 6600)
+++
xwiki-platform/core/trunk/xwiki-core/src/main/java/com/xpn/xwiki/plugin/fileupload/FileUploadPlugin.java
2008-01-02 18:29:14 UTC (rev 6601)
@@ -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);
_______________________________________________
notifications mailing list
[email protected]
http://lists.xwiki.org/mailman/listinfo/notifications