There is 1 comment.
 
 
XWiki Platform / cid:jira-generated-image-avatar-e3a22d60-a537-4c16-bf23-ae1643d000a2 XWIKI-22784 Open

Links to a page itself are not updated when moving or renaming the page

 
View issue   ยท   Add comment
 

1 comment

 
cid:jira-generated-image-avatar-724b06b3-edb2-41fa-8108-47151319d703 Vincent Massol on 01/Oct/26 10:55
 

Note that XWIKI-23926 (closed as duplicate of this issue) reports that the same problem also affects attachment/image references pointing to the page itself, not only links:

  • Create page Sandbox.P1.WebHome with [[image:Sandbox.P1.WebHome@image.jpg]] (an attach: prefix doesn't change anything)
  • Rename it to Sandbox.P2.WebHome
  • The image reference still points to Sandbox.P1.WebHome@image.jpg and the image is broken

Root cause analysis (copied from XWIKI-23926): absolute references are currently never changed because they point to absolute locations and are thus considered independent of renames. The relevant code is ResourceReferenceRename#updateRelativeResourceReference(...):

EntityReference linkEntityReference = this.entityReferenceResolver.resolve(resourceReference, null, newReference);
// current link, use the old document's reference to fill in blanks.
EntityReference oldLinkReference = this.entityReferenceResolver.resolve(resourceReference, null, oldReference);

Since the resource reference is absolute, resolving it against newReference doesn't change it. References that point to the page being moved (or to one of its attachments) should be updated to point to the new location.