Uploaded image for project: 'XWiki Commons'
  1. XWiki Commons
  2. XCOMMONS-3886

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

    XMLWordPrintable

Details

    • Unit, Integration
    • Unknown

    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/

      Attachments

        Issue Links

          Activity

            People

              vmassol Vincent Massol
              vmassol Vincent Massol
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: