Is it possible to have an array
as an user option? For example a list of namespaces or categories. Using
"DefaultUserOptions": {
"my-ext-enabled-namespaces": [ 0 ],
in extension.json
causes an issue in User::getOptions
[1]. The only examples that I’ve found [2][3] suggest that a list can only be saved as delimiter-seperated-string. In that case I would either need to deserialize it in the place I use it, or bind to UserGetOptions
hook. Any suggestions on this? Or best practices?
[1] https://github.com/wikimedia/mediawiki/blob/master/includes/user/User.php#L2938
[2] https://github.com/wikimedia/mediawiki/blob/a79d012e1c40dbeeb55a90b8099fea4aa9b1270b/includes/user/User.php#L5332-L5336
[3] https://github.com/wikimedia/mediawiki-extensions-Translate/blob/7bef0ed3ec963baf391bece71f51c11afe0160a3/translationaids/InOtherLanguagesAid.php#L57-L59