Updated links when copying tree

Is there a way to make the links you create update when copying a tree? I want the links in the new tree to link relative to itself, and not back to the old tree that was copied.

I don’t think that exist. However if the links were relative in the first place, the copy will keep them relative.

Feel free to create a jira issue for it at XWiki Platform - XWiki.org JIRA

image

If that option was under copy, it would solve my problems.

How would I make the links relative in that case? I can’t seem to figure it out.

Yes sure, your use case is valid which is why I was suggesting that you could create a jira issue for it. Note that “update links” in your screenshot doesn’t do what you want; it doesn’t make links relative.

See https://www.xwiki.org/xwiki/bin/view/Documentation/UserGuide/Features/XWikiSyntax/?syntax=2.1&section=Links for some examples.

Quick examples: [[PageA]], [[.PageA]], [[page:../SiblingPage]]

If I use those syntaxes, the links still update and point back to the original page. [[.PageA]] turns into [[ParentA.PageA.WebHome]]. I simply can’t stop it from pointing back to the original parent.

Can’t seem to make

#set ($discard = $copyAsRequest.setAutoRedirect(false))

work either.