Description
In XWiki.XWikiPreferencesInitalizer ( https://github.com/xwiki/xwiki-platform/blob/master/xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/internal/mandatory/XWikiPreferencesDocumentInitializer.java#L106 ), we have some lines like this:
needsUpdate |= bclass.addStaticListField("editor", "Default Editor", "---|Text|Wysiwyg"); needsUpdate |= bclass.addStaticListField("registration_anonymous", "Anonymous", "---|Image|Text"); needsUpdate |= bclass.addStaticListField("leftPanelsWidth", "Width of the left panel column", "---|Small|Medium|Large");
The problem is that the value "--- " should not be stored in the db, since it means "default". Instead, the default should be the empty value with a displayer to show "--- " in the UI.
The problem is that xwiki.getSpacePreference() does not fallback to xwiki.getWikiPreference() when the value is "--- ", because it currently only fallback on empty value (ex: XWIKI-10787).
Different fixes are possibles:
- change XWiki.XWikiPreferences to not store "--- " anymore with either a migrator to remove the current "--- " values or either a fallback on xwiki.getSpacePreference() when the value is "--- " (for retro-compatibility)
- only change xwiki.getSpacePreference() to fallback when the value is "--- ".
Attachments
Issue Links
- depends on
-
XWIKI-15730 Always provide an empty choice for non multi list select based editor
- Closed
- is related to
-
XWIKI-10854 xwiki.getSpacePreference() and xwiki.getSkinPreference() do not fallback when the value is "---"
- Closed
- relates to
-
XWIKI-10787 If panelsWidth is set to '---' at Space level it does not fallback on XWiki.XWikiPreferences
- Closed