My WS client is calling core_user_get_users_by_field. While testing it against my account on moodle.org, I got the following exception:
It turns out that core_user_external::user_description() expects preferences names are always PARAM_ALPHANUMEXT. But there is no such restriction in the preferences API itself, nor is such requirement documented.
By looking into moodle.org database, it is only this particular plugin's preference editor_marklar/formats violating the rule for now. All others see to be fine.
We should either
- Be more benevolent to the preferences names and fix the external lib.
- Be more explicit on preferences names and perform the same validation in the get/set API too. If we go this way, we should start throwing developer debugging first and then eventually turn into hard requirement. Hopefully the Marklar editor author will be kind enough to change their plugin and perform an upgrade there.