Page MenuHomePhabricator

wgRelevantUserName is unevenly defined between Special:Block and Special:DeletedContributions
Open, LowestPublic

Description

Checking mw.config.exists('wgRelevantUserName') as a non-sysop account/IP will return:

  • False on Special:DeletedContributions
  • True on Special:Block

I'd expect there to be agreement here, since there's no page content that a user can interact with on. Not sure if there are others that are divided; Special:UserRights shows the log and lookup to everyone so it makes sense to return true.

Event Timeline

Restricted Application added a subscriber: Aklapper. · View Herald TranscriptJan 26 2020, 7:15 PM
SD0001 triaged this task as Lowest priority.Jan 26 2020, 10:11 PM
SD0001 added a project: JavaScript.
This comment was removed by Ammarpad.

Needs an example. Special:DeletedContributions is setting the relevant user after validation of the user from the input. Same for Special:Block

I think you might be missing the "non-sysop" part? For a non-sysop, Special:Block defines the name, and links are provided in the sidebar for logged-in users (contributions, logs). For Special:DeletedContributions, this is not the case.

Umherirrender added a comment.EditedAug 7 2020, 3:42 PM

Does the "non-sysop" is the viewer of the special page or the user selected on the special page (the "relevant user")?

both pages are not viewable for non-sysop in a default mediawiki, what for user rights the viewer has?

I cannot follow this on a default mediawiki. Please provide an example or steps to reproduce or upload a screenshot

  1. Be a non-sysop user, including logged-out
  2. Go to Special:Block/Jimbo (the actual account being "viewed" doesn't matter)
  3. mw.config.get('wgRelevantUserName') -> Jimbo
  4. Go to Special:DeletedContributions/Jimbo (the actual account being "viewed" doesn't matter)
  5. mw.config.get('wgRelevantUserName') -> null
Amorymeltzer updated the task description. (Show Details)Aug 7 2020, 4:19 PM

Both showing an error message about missing permissions.

Is there a benefit when also having the relevant user?
The order of checks is not the same for both special pages resulting in this different.

If it were up to me, I'd say it's better to have it defined; any script/etc. that's dependent on wgRelevantUserName (to, say, add links or lookup user info) wouldn't work otherwise. The target user is known, regardless of whether the viewer can manipulate the Special page in question. At the very least, there should be agreement.

Both showing an error message about missing permissions.

On the page, I would hope so!

Disregard my earlier comment which confused the issue with something else.

If it were up to me, I'd say it's better to have it defined; any script/etc. that's dependent on wgRelevantUserName (to, say, add links or lookup user info) wouldn't work otherwise. The target user is known, regardless of whether the viewer can manipulate the Special page in question. At the very least, there should be agreement.

Changing this might be tricky and maybe not worth the effort. I think script authors should do some existence check instead of blindly assuming relevant user is set always.

I think script authors should do some existence check instead of blindly assuming relevant user is set always.

That's not what I'm suggesting. I'm saying a place where the information is known to anyone looking at the computer screen would expect a tool to work, or to expect pages to behave similarly. A tool or script doing everything correctly is exactly how this incongruity would (and in my case, did) get noticed.