Details
-
Bug
-
Resolution: Duplicate
-
Major
-
None
-
5.4
-
Unknown
-
N/A
-
N/A
-
Description
If you have a page containing an XClass that's been generated by XWiki (for example XWiki.StyleSheetExtension) and you upgrade your XWiki version, if the new version has modifications in the XClass, the generated XClass will not be updated.
This is because all code in BaseClass.java use the following logic:
public boolean addStaticListField(String fieldName, String fieldPrettyName, int size, boolean multiSelect, boolean relationalStorage, String values, String displayType, String separators) { if (get(fieldName) == null) { ... return true; } return false; }
And the calling code does something like this:
needsUpdate |= bclass.addStaticListField(USE_FIELDNAME, "Use this extension", useOptions);
The call to addStaticListField will return false because the xclass field already exists, even though its list of items may have changed (or its pretty name, etc).
BaseClass needs to be improve to check for differences in all passed parameters.