Hi,

I fail to reproduce this on XWiki 4.2, for some reason, but looking at the code I'd say that there is clearly a bug in that it is assumed in the method 'getDeletedAttachment' that there exist some deleted versions of the file corresponding to the attachment template passed as an argument.

I'll commit a fix.

Best Regards,

/Andreas



2012-06-27 08:25, Thomas Mortagne skrev:
On Wed, Jun 27, 2012 at 12:05 AM, Jan Matuska<[email protected]>  wrote:
Hello Devs,

I am using XWiki 4.0 with filesystem attachment storage and face the following 
problem:

1. Add a new page, make several edits and save. In the history section of the 
page navigate to any previous version - no problem.

2. Now insert an attachment (e.g. an image) to the page, save. Do some more 
edits to the page, save. In the history section navigate to previous versions 
of the page. It will work with versions previous to the attachment upload. 
Navigating to any version that was saved after the attachment upload will cause 
the following problem:

Error number 4001 in 4: Error while parsing velocity page 
/templates/contentview.vm Wrapped Exception: Failed to evaluate content with id 
[/templates/contentview.vm]

and

...
Caused by: java.lang.NullPointerException
        at 
org.xwiki.store.legacy.store.internal.FilesystemAttachmentRecycleBinStore.getAllDeletedAttachments(FilesystemAttachmentRecycleBinStore.java:293)
        at 
com.xpn.xwiki.web.XWikiServletURLFactory.findDeletedAttachmentForDocRevision(XWikiServletURLFactory.java:573)
        at 
com.xpn.xwiki.web.XWikiServletURLFactory.createAttachmentURL(XWikiServletURLFactory.java:390)
        at 
com.xpn.xwiki.doc.DefaultDocumentAccessBridge.getAttachmentURL(DefaultDocumentAccessBridge.java:606)
...

3. Now, instead of viewing an older version of that page, rollback to any 
version previous to attachment upload.

4. Only after this rollback all previous versions are visible and do not cause 
an error any more.

It seams that XWiki is missing a folder of deleted attachments and fails to render 
versions following an attachment upload, therefore. When I perform the rollback a 
"deleted_attachments" folder is generated in the filesystem and the error 
dissappears.
To have all page versions available you have to perform a rollback and -forward 
after every new attachment upload. This is not very elegant - are there any 
other solutions or am I missing out something? Besides of this filesystem is a 
fine thing since I have some very large attachments. However, version control 
is important for me. Is there a solution or should I switch to Database Storage 
again?

When you see java.lang.NullPointerException you can be sure there is a
bug somewhere. Would be great if you could create an issue on
http://jira.xwiki.org with all details to reproduce it.

Thanks for any advise,
Helge
--
NEU: FreePhone 3-fach-Flat mit kostenlosem Smartphone!
Jetzt informieren: http://mobile.1und1.de/?ac=OM.PW.PW003K20328T7073a
_______________________________________________
devs mailing list
[email protected]
http://lists.xwiki.org/mailman/listinfo/devs



_______________________________________________
devs mailing list
[email protected]
http://lists.xwiki.org/mailman/listinfo/devs

Reply via email to