There is 1 comment.
 
 
XWiki Platform / cid:jira-generated-image-avatar-b370471a-f26f-4d3e-9f0c-d8ee93bf31a2 XWIKI-7047 Open

In a DocumentCreated EventListener, if the saved document is modified and saved again, a DocumentCreatedEvent is sent instead of a DocumentUpdatedEvent

 
View issue   ยท   Add comment
 

1 comment

 
cid:jira-generated-image-avatar-a724e13f-3478-40b3-9c32-03b128134e33 Anca Luca on 19/Jun/24 19:01
 

It looks indeed incorrect to modiy the document received from the event, for an *ed event. It should at least .clone() it, as per the good practices of working with XWikiDocuments. I am wondering what happens if we do clone that XWikiDocument.

We could close this as invalid, I don't remember the usecase I had (it was 13 years ago), whether I needed absolutely to modify that object and why.