Page MenuHomePhabricator

Expose user realname through mw.user.options or mw.config
Open, LowPublic

Description

Users real name isn't showing up in mw.user.options.

It shows up in the preference page just fine, but for some reason it's not being propagated out to the javascript stuff.

I got around it by using the MakeGlobalVariablesScript hook, but that seems a less than optional solution for something that's should be a normal user preference.

Tested on MW 1.25.2 and 1.27.1

Event Timeline

realname is not a regular user preference – it's really more like the email, which also isn't in mw.user.options. (Internally, it's stored in the user.user_real_name table column, rather than in the user_properties table.)

It would probably be easier (and maybe more sensible? I'm not sure…) to expose it in a similar way to the username (mw.config.get('wgUserName')).

Krinkle renamed this task from realname not showing up in mw.user.options to Expose user realname through mw.user.options or mw.config.May 8 2017, 12:23 AM
Krinkle triaged this task as Low priority.
Krinkle edited projects, added MediaWiki-User-management; removed MediaWiki-General.
Krinkle moved this task from Backlog to Other on the MediaWiki-User-management board.