Details
-
Bug
-
Resolution: Fixed
-
Major
-
2.4
-
None
Description
Problem
RN-73 registered the application in the wiki Administration by adding an XWiki.ConfigurableClass xobject to ReleaseNotes.Code.ReleaseNotesConfig.
However RN-71 had declared that same page with the configuration XAR entry type in application-releasenotes-ui/pom.xml. That entry type maps to UpgradeType.SKIP_ALLWAYS, which the Extension Manager implements as "only install the document, never upgrade it":
private XWikiDocument SKIP_ALLWAYS(XWikiDocument currentDocument, XWikiDocument previousDocument, XWikiDocument nextDocument, XWikiDocumentMergerConfiguration configuration) { XWikiDocument result = currentDocument; // Only install the document (no upgrade) if (currentDocument == null && previousDocument == null) { result = nextDocument; } return result; }
As a consequence, on any wiki where the Release Notes application was already installed the page already exists, so upgrading to 2.4 leaves ReleaseNotes.Code.ReleaseNotesConfig untouched and the XWiki.ConfigurableClass xobject is never added.
Reproduced by upgrading a 2.3 instance to 2.4: the xobject is absent from ReleaseNotes.Code.ReleaseNotesConfig and Administration has no Release Notes entry. Only fresh installs get the Administration section, so the feature added by RN-73 is invisible to every existing user.
More generally, ReleaseNotes.Code.ReleaseNotesConfig mixes application structure (the XWiki.ConfigurableClass xobject and the xclass definitions) with administrator data (the product and template values), and the configuration entry type freezes both. Any future structural change to that page would be lost in the same way.
Proposal
Remove the configuration entry declaration for ReleaseNotes.Code.ReleaseNotesConfig so that the page uses the default XAR entry type, and thus the default THREEWAYS upgrade behavior (a 3-way merge). Structural changes then reach existing installs, while the values an administrator changed are preserved by the merge.
This is what XWiki Platform does for XWiki.RegistrationConfig, which has exactly the same shape: an XWiki.ConfigurableClass xobject plus the xobject of its own configuration xclass on a single page. Both must be on the same page because XWiki.ConfigurableClass looks the configuration xobject up on its own document. In Platform the configuration entry type is only used for pure-data pages such as XWiki.XWikiAdminGroup, never for pages that also carry application structure.
Side effect: editing ReleaseNotes.Code.ReleaseNotesConfig directly shows the standard "this page belongs to an extension" warning again, which was the symptom reported in RN-71. This is acceptable now that RN-73 provides the Administration section, which is the supported way to configure the application and which saves the configuration without going through the page editor.
Note: instances that have already been upgraded to 2.4 are not repaired by this change, because the 3-way merge sees no difference between the 2.4 and the 2.4.1 version of the xobject. On those the xobject has to be added by hand, or the page deleted and the extension reinstalled. Upgrading straight from 2.3 or earlier to 2.4.1 works.