Details
-
Bug
-
Resolution: Unresolved
-
Major
-
None
-
3.1.1
-
None
-
Unknown
-
Description
To reproduce, you should use a code like this in a DocumentCreatedEvent listener:
XWikiDocument currentDocument = (XWikiDocument) source; XWikiContext context = (XWikiContext) data; // create some new object in the document here, change stuff in it ... context.getWiki().saveDocument(currentDocument, ...)
On this last save, the same DocumentCreatedEvent is being fired, even if we're saving a document which already exists.
The issue might be caused by the fact that this code is casting event parameters to XWikiDocument (which is oldcore), but there are enough situations when listeners need to use the fact that the event params are XWikiDocuments (and anyway, some cast need to be done, so I would say that we cannot call this issue a "won't fix" for this reason).