Details
-
Improvement
-
Resolution: Unresolved
-
Minor
-
None
-
18.9.0-rc-1
-
None
-
Unknown
-
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.
Attachments
Issue Links
- relates to
-
XWIKI-25068 Wiki skin files are corrupted when processed as wiki syntax (e.g. when renaming a page they reference)
-
- Closed
-