There is 1 comment.
 
 
XWiki Platform / cid:jira-generated-image-avatar-c12288de-19d3-4a67-a391-f28ee66dfa8b XWIKI-23926 Open

Absolute references pointing to current page are not updated on rename

 
View issue   ยท   Add comment
 

1 comment

 
cid:jira-generated-image-avatar-5ae191c5-fff6-4ac3-8422-2f96ae8587b8 Vincent Massol on 20/Feb/26 13:26
 

Right now, the way it works is that absolute references are not changed because they point to absolute locations and thus are independent of renames. Now I agree that it's not the most logical from a user POV and it would be better to make an exception for references pointing to the current page being moved.

I think the fix is in {{ResourceReferenceRename#updateRelativeResourceReference(ResourceReference resourceReference,
T oldReference, T newReference, Map<EntityReference, EntityReference> updatedEntities)}} method, which does:

        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);

This will not change the linkEntityReference because the resourceReference is absolute and thus the resolving, passing the newReference as the last parameter won't change it. We need to compare if the resourceReference being updated is exactly matching the passed oldReference and if so swap it for the newReference.