Hi devs,
As you probably know already, the XWikiPreference document is a huge mess and is pretty much the worst possible example of extension page, containing a mix of everything that should never be mixed in the same document: xclass, custom rights, default configuration, custom configuration, etc. It even contains things which are actually more UI elements that we would usually put in templates, UI extensions, or even email templates if they were introduced today:
meta
: part of the HTML tagconfirmation_email_content
andvalidation_email_content
: I assume, according to their content, mail templates used in the validation process.
Since XWikiPreferences is such a mess and would be way too dangerous to merge, it’s not merged. This means that the UI elements indicated above are never updated during an XWiki upgrade.
For now, I would like to propose a very simple change to improve the situation for future new installations for those 3 UI elements: move their content to their own location, and in the code where we currently evaluate the content of those 3 fields have a fallback on those new locations when the content is empty.
That way, when an instance which started with this logic is upgraded, it will benefit from update/fix of those default content. It also means that it’s easy to include the content of the template when you just want to add stuff before/after the standard content without modifying it.
For the locations I propose templates in xwiki-platform-web-templates since those templates are easy to include, and their content seems generic enough for any skin (but it would still allow a skin to customize them).
WDYT ?
Here is my +1 for moving those scripts to upgradable locations and +1 for these locations to be xwiki-platform-web-templates templates.