Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

XWIKI-22931: The edit action modify the cached document when creating a page from template #3943

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

surli
Copy link
Member

@surli surli commented Feb 27, 2025

Jira URL

https://jira.xwiki.org/browse/XWIKI-22931

Changes

Description

  • Fix XWikiDocument#copyAttachment to actually perform a real clone including the copy of the content
  • Introduce a XWikiAttachment#cloneWithActualContent to clone and copy the content
  • Introduce a XWikiAttachmentContent#clone(boolean) that allows to decide to skip or not copying the content

WIP: right now tests are passing but it shows a regression in logs when running PageTemplatesIT, probably due to the ownerDocument of XWikiAttachmnentContent in clone method

Clarifications

Screenshots & Video

Executed Tests

Expected merging strategy

  • Prefers squash: Yes
  • Backport on branches:
    • 16.10.x
    • 16.4.x

… a page from template

  * Fix XWikiDocument#copyAttachment to actually perform a real clone
    including the copy of the content
  * Introduce a XWikiAttachment#cloneWithActualContent to clone and copy
    the content
  * Introduce a XWikiAttachmentContent#clone(boolean) that allows to
    decide to skip or not copying the content

WIP: right now tests are passing but it shows a regression in logs when
running PageTemplatesIT, probably due to the ownerDocument of
XWikiAttachmnentContent in clone method
{
XWikiAttachmentContent clone = new XWikiAttachmentContent(this);
// this AttachmentContent is not attached to any document yet.
clone.setOwnerDocument(null);
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note that this is also used for the standard clone(), maybe we need to avoid that?

@surli surli self-assigned this Mar 4, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant