This issue has been created
There are 2 updates.
 
 
XWiki Platform / cid:jira-generated-image-avatar-dc5249d0-8104-450b-91e1-1614a511ccf9 XWIKI-25072 Open

Update links and backlinks of wiki skin templates written in wiki syntax

 
View issue   ยท   Add comment
 

Issue created

 
cid:jira-generated-image-avatar-de6c640f-540e-4afe-b620-c68cd75b6260 Vincent Massol created this issue on 01/Oct/26 16:47
 
Summary: Update links and backlinks of wiki skin templates written in wiki syntax
Issue Type: cid:jira-generated-image-avatar-dc5249d0-8104-450b-91e1-1614a511ccf9 Improvement
Assignee: Unassigned
Components: Old Core, Refactoring
Created: 01/Oct/26 16:47
Priority: cid:jira-generated-image-static-major-f033a8d3-a085-4923-bfcf-2c0bbb44b084 Major
Reporter: Vincent Massol
Description:

Context

A skin template stored in a wiki page (the content of an XWiki.XWikiSkinFileOverrideClass object, or a template property of the XWiki.XWikiSkins object of a skin page) can be written in wiki syntax by starting it with a header such as:

##!source.syntax=xwiki/2.1

Since XWIKI-25068, these properties have a PureText content type so that they're no longer parsed and re-rendered as wiki content in the syntax of the skin page, which used to corrupt them. As a consequence, for wiki syntax templates:

  • the links they contain are no longer updated when the linked page is renamed or moved;
  • the skin page no longer appears in the backlinks of the pages they link to.

(Before XWIKI-25068 the link was updated, but the template got corrupted at the same time: the ##!source.syntax header line was parsed as an XWiki 2.1 monospace format, and a stray ## was added to the template.)

Example

A company skin overrides the children.vm template (which is a ##!source.syntax=xwiki/2.1 template) to add a help line:

##!source.syntax=xwiki/2.1
...
(% class="help" %)See [[How we organize pages>>Company.Help.Organizing]].

When Company.Help.Organizing is moved to Documentation.Organizing, the link in the skin template still targets Company.Help.Organizing. It keeps working only thanks to the redirect left by the rename (the default), and breaks if no redirect is kept or if it is removed later.

Improvement

Handle wiki skin templates that declare a source syntax when extracting links (backlinks) and when updating links on rename/move: parse the template content in the syntax declared by its ##!source.syntax header (not in the syntax of the skin page), leave the header lines untouched, and only re-serialize the content when a reference actually changed. Templates without such a header are Velocity (or CSS/JS evaluated by Velocity) and must keep being ignored.

 
 

2 updates

 
cid:jira-generated-image-avatar-de6c640f-540e-4afe-b620-c68cd75b6260 Changes by Vincent Massol on 01/Oct/26 16:49
 
Version: 18.9.0-rc-1
Priority: Major Minor