There is 1 comment.
 
 
XWiki Platform / cid:jira-generated-image-avatar-9d29476b-8813-4427-a3ad-b9008dd34766 XWIKI-10126 Open

Page copy: add an option to prevent copying source page history

 
View issue   ยท   Add comment
 

1 comment

 
cid:jira-generated-image-avatar-4531b566-3bf9-4b0b-88a2-f845d3369cf1 Vincent Massol on 26/Jul/24 10:42
 

Technically the issue is that CopyJob.java is calling ModelBridge#copy() at https://github.com/xwiki/xwiki-platform/blob/402653007531cde924e4564c74a13bf27d018ecf/xwiki-platform-core/xwiki-platform-refactoring/xwiki-platform-refactoring-api/src/main/java/org/xwiki/refactoring/internal/job/CopyJob.java#L91 and ModelBridge#copy() doesn't support a "reset" parameter and thus always calls XWki#copyDocument passing true for the "reset" parameter, see https://github.com/xwiki/xwiki-platform/blob/402653007531cde924e4564c74a13bf27d018ecf/xwiki-platform-core/xwiki-platform-refactoring/xwiki-platform-refactoring-default/src/main/java/org/xwiki/refactoring/internal/DefaultModelBridge.java#L175

So we need to do 3 things:

  • Add a reset parameter in ModelBridge
  • Add some methods in CopyRequest to define if copying the history should be done or not
  • Expose the option in the UI (to be decided if that's for everyone or only for advanced users - I'd not copy the history by default and allow advanced users to have the option to copy the history)