Description
The issue only happen when using the Filesystem attachement versioning and the XWiki#CopyDocument() is used with resetCreationData set to false.
With this argument, the copied document is supposed to be identical to the original document without any trace of the copy action, exact same dates and history.
In the process of the FilesystemAttachmentVersioningStore, the XWikiAttachment#setDoc() method is called (see https://github.com/xwiki/xwiki-platform/blob/master/xwiki-platform-core/xwiki-platform-store/xwiki-platform-store-filesystem-oldcore/src/main/java/org/xwiki/store/legacy/doc/internal/ListAttachmentArchive.java#L331) causing the XWikiDocument#setMetadataDirty(true) to called on the copied document (see https://github.com/xwiki/xwiki-platform/blob/master/xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/doc/XWikiAttachment.java#L453).
Since the metadata dirty get set, the save of the copy cause the modification date to be changed and a new revision to be created.
$xcontext.getXWiki().copyDocument($sourceRef, $targetRef, $NULL, false, true, false, $xcontext.context)
Attachments
Issue Links
- blocks
-
XWIKI-13267 Turn on filesystem attachment store by default
- Closed