This issue has been created
There is 1 update.
 
 
XWiki Commons / cid:jira-generated-image-avatar-257c73ed-2a69-477d-b45f-cb39243f96bc XCOMMONS-3886 Open

Make the XAR plugin check and raise a page's XAR format version to the one its elements require

 
View issue   ยท   Add comment
 

Issue created

 
cid:jira-generated-image-avatar-32daaeb3-21d1-457d-8cec-3112271b0bdd Vincent Massol created this issue on 09/Nov/26 12:33
 
Summary: Make the XAR plugin check and raise a page's XAR format version to the one its elements require
Issue Type: cid:jira-generated-image-avatar-257c73ed-2a69-477d-b45f-cb39243f96bc Improvement
Affects Versions: 17.10.14
Assignee: Unassigned
Components: Development Issues only
Created: 09/Nov/26 12:33
Priority: cid:jira-generated-image-static-major-1eb3dd41-e01e-4b31-b183-c509488e12e4 Major
Reporter: Vincent Massol
Description:

A wiki page XML file declares the version of the XAR format it follows in the version attribute of its xwikidoc root element. Some elements only exist since a given format version, but nothing checks that a page using them declares that version: for example a page with enforceRequiredRights can declare format 1.2 and pass both mvn xar:format and mvn xar:verify, while claiming a format that does not contain the element it uses.

Proposed change

  • xar:verify fails a page whose declared format version is lower than the one introducing an element it uses:
    • attachment/revisions: 1.4
    • originalMetadataAuthor: 1.5
    • enforceRequiredRights: 1.6
    • the type attribute of an object property: 1.7
  • xar:format raises the declared format version to the one required, so that formatting a page fixes it.

The reference/locale root attributes (1.2) and the XML 1.1 declaration (1.3) are not checked: xar:format writes the XML 1.1 declaration on every page, and many existing pages declaring an older version carry these attributes with no effect on their import.

Extensions with pages in that situation will see their build fail once they use this version of the plugin; running mvn xar:format fixes them.

See https://www.xwiki.org/xwiki/bin/view/documentation/xs/admin/exports/export-content-xar-format/format-specifications/document-xml/

 
 

1 update

 
cid:jira-generated-image-avatar-32daaeb3-21d1-457d-8cec-3112271b0bdd Changes by Vincent Massol on 09/Nov/26 12:33
 
Assignee: Vincent Massol