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:
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:
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 "--- ".