Details
-
Bug
-
Resolution: Duplicate
-
Major
-
None
-
1.9 M1, 1.8.2
-
None
-
Unknown
-
Description
This is the code we need to change:
if (!this.backupPack) { // if the import is not a backup pack with set the user to the importing user doc.getDoc().setAuthor(context.getUser()); doc.getDoc().setContentAuthor(context.getUser()); // if the import is not a backup pack we set the date to now Date date = new Date(); doc.getDoc().setDate(date); doc.getDoc().setContentUpdateDate(date); } if ((!this.preserveVersion) && (!this.withVersions)) { doc.getDoc().setVersion("1.1"); } // We don't want date and version to change // So we need to cancel the dirty status doc.getDoc().setContentDirty(false); doc.getDoc().setMetaDataDirty(false); for (XWikiAttachment xa : doc.getDoc().getAttachmentList()) { xa.setMetaDataDirty(false); xa.getAttachment_content().setContentDirty(false); } context.getWiki().saveDocument(doc.getDoc(), context); doc.getDoc().saveAllAttachments(false, true, context); addToInstalled(doc.getFullName() + ":" + doc.getLanguage(), context); if (this.withVersions) { // we need to force the saving the document archive. if (doc.getDoc().getDocumentArchive() != null) { context.getWiki().getVersioningStore().saveXWikiDocArchive( doc.getDoc().getDocumentArchive(context), true, context); } } // if there is no archive in xml and content&metaData Dirty is not set // then archive was not saved // so we need save it via resetArchive if ((doc.getDoc().getDocumentArchive() == null) || (doc.getDoc().getDocumentArchive().getNodes() == null) || (!this.withVersions)) { doc.getDoc().resetArchive(context); }
We need to retrieve the history of the previous document in place.
Attachments
Issue Links
- duplicates
-
XWIKI-831 Import wizard should conserve version history
- Closed