There is 1 update.
 
 
XWiki Platform / cid:jira-generated-image-avatar-a3c77462-39d0-472b-9eb9-14019d2b1423 XWIKI-22962 Open

XClasses are not upgraded as expected when modified locally

 
View issue   ยท   Add comment
 

1 update

 
cid:jira-generated-image-avatar-f1218d21-1462-4125-ba8e-d5e8b8a2d2cb Changes by slauriere on 10/Mar/25 17:21
 
Description: h2. Steps to reproduce
* Create a XAR extension containing an XClass {{XWiki.Test.TestClass}} with one String field named {{{}field1{}}}.
* Build version 1.0 of that extension and install it with the Extension Manager.
* Add an XObject to page {{{}XWiki.Test.TestClass{}}}, for example an instance of {{{}MovieClass{}}}.
* Create version 1.1 of the extension with an additional String field named {{{}field2{}}}.
* Upgrade the extension to 1.1.

h2. Expected result

Page {{XWiki.Test.TestClass}} contains the new field {{{}field2{}}}.
h2. Actual result

Page {{XWiki.Test.TestClass}} remains unchanged once the upgrade has completed. However, if the TestClass page is not modified locally before getting upgraded, the new field is added as expected during the upgrade.
h2. Screens

The captures below show the diffs between:
* {{current}} and {{{}new{}}}: as expected, the screen shows the added object is not present in the new version, and that a field was added in the new version.
* {{current}} and {{{}merged{}}}: no change is shown, while the new field should be displayed.

!diff-current-next.png|thumbnail! !diff-current-merged.png|thumbnail!
h2. Sample extension

Here is attached a test extension ready to be built
: [^org . xwiki.contrib.test-1.0.zip] {{TestClass.xml}} contains two field declarations. The second one needs to be removed for when building version 1.0, and added to build version 1.1.