Page MenuHomePhabricator

Output the selected username value as a variable in Special:Listfiles, such that MediaWiki:Listfiles-summary can utilize it
Open, Needs TriagePublicFeature

Description

Feature summary: I want the link to a user's upload log at Special:ListFiles/USER to work however the URL is formatted.

Use case(s): If the URL is written as such: https://en.wikipedia.org/wiki/Special:ListFiles/Jonteemil the link works. If the URL is written as such: https://en.wikipedia.org/wiki/Special:ListFiles?user=Jonteemil the link doesn't work, it just takes you to the generic upload log instead. The reason for this is that #titleparts is used to get the username from the URL and it of course can't when there isn't any slash to seperate the username from the rest of the URL.

Benefits: The user=Jonteemil version of the URL is generated when the checkbox for showing previous versions is checked. If you uncheck it, the user=Jonteemil version is still generated. So if you have checked or checked and then unchecked the checkbox the link doesn't take you to the user's upload log. The same is true for when you change the number of files to show per page or if you change the page.

Discussions regarding the issue in-wiki: https://en.wikipedia.org/wiki/MediaWiki_talk:Listfiles-summary#Protected_edit_request_on_18_January_2022

Event Timeline

The "link" on commonswiki and enwiki is a local message hack using #titleparts. If Special:ListFiles would output the user argument to a $1 variable, we could incorporate it in to the message in more situations.

@Jonteemil FYI, the default message doesn't have #titleparts. It is used on w:en:MediaWiki:Listfiles-summary by enwiki admins as a workaround to detect the relevant username instead of using a direct variable (similar to wgRelevantUserName in JavaScript) since there are no such thing in wikitext.

Edit: And yes, I support Xaosflux's solution.

@NguoiDungKhongDinhDanh You're correct. I guess only enwiki and Commons are affected by this. Should still be fixed nonetheless.

Which specific message is this about that should be altered? Could someone update the task summary, please?

Xaosflux renamed this task from The link to a user's upload log at Special:ListFiles/USER doesn't work when the URL is altered to Output the selected username value as a variable in Special:Listfiles, such that MediaWiki:Listfiles-summary can utilize it.Jan 19 2022, 5:12 PM