Page MenuHomePhabricator

Consolidate user‑upload aliases in MessagesEn.php
Open, In Progress, LowPublicBUG REPORT

Description

Very minor Technical-Debt issue in /languages/messages/MessagesEn.php

What’s the problem?:

In MessagesEn.php, there are two separate alias entries that resolve to the same special page and behave identically:

Line 429:

'AllMyUploads' => [ 'AllMyUploads', 'AllMyFiles' ]

Line 504:

'Myuploads' => [ 'MyUploads', 'MyFiles' ],

All redirect to Special:ListFiles/[$username].

What can be done about it?:

The two entries can be consolidated into a single line by:

  • Deleting line 429 ('AllMyUploads' => [ 'AllMyUploads', 'AllMyFiles' ]), and
  • Adding its aliases to line 504, so that line (now line 503) becomes:
'Myuploads' => [ 'MyUploads', 'MyFiles', 'AllMyUploads', 'AllMyFiles' ],

This keeps the same behaviour but reduces duplication. I think it's better to keep line 504 because then it's listed as part of the block of other special pages beginning My..., i.e. MyLanguage, MyLog, MyPage and MyTalk.

Good first task:

This is a good candidate for a good first task, because it only involves:

  • Removing one line, and
  • Updating a second line with additional aliases.

No functional changes occur, and the change is limited to message‑alias definitions in English.

Details

Event Timeline

Thank you for tagging this task with good first task for Wikimedia newcomers!

Newcomers often may not be aware of things that may seem obvious to seasoned contributors, so please take a moment to reflect on how this task might look to somebody who has never contributed to Wikimedia projects.

A good first task is a self-contained, non-controversial task with a clear approach. It should be well-described with pointers to help a completely new contributor, for example it should clearly point to the codebase URL and provide clear steps to help a contributor get set up for success. We've included some guidelines at https://phabricator.wikimedia.org/tag/good_first_task/ !

Thank you for helping us drive new contributions to our projects <3

VadymTS1 triaged this task as Low priority.

Change #1290487 had a related patch set uploaded (by VadymTS1; author: VadymTS1):

[mediawiki/core@master] Consolidate user‑upload aliases in MessagesEn.php

https://gerrit.wikimedia.org/r/1290487

VadymTS1 changed the task status from Open to In Progress.Thu, May 21, 5:59 AM

Change #1290487 abandoned by VadymTS1:

[mediawiki/core@master] Consolidate user‑upload aliases in MessagesEn.php

Reason:

Does not skip the change with the deletion of one of the special pages

https://gerrit.wikimedia.org/r/1290487

VadymTS1 subscribed.

SpecialAllMyUploads and SpecialMyuploads are functionally distinct in a way the task description doesn't capture: SpecialAllMyUploads.getRedirect() sets $this->mAddedRedirectParams['ilshowall'] = 1, forcing old/superseded file revisions into the redirect to Special:Listfiles/{user}. SpecialMyuploads does not set this, though it lists ilshowall in mAllowedRedirectParams, meaning it can be passed through explicitly. This difference appears load-bearing rather than incidental; see T32607, whose patch introduced the ilshowall-forcing behaviour so old/superseded revisions remain visible in a user's file list.

Based on reading the source, the proposed MessagesEn.php-only patch appears to have two problems:

  1. Moving AllMyUploads as a language alias of Myuploads looks like a no-op. AllMyUploads is registered in CORE_LIST in SpecialPageFactory, so getAliasList() registers allmyuploads → AllMyUploads as a protected canonical self-alias in its first pass. The second pass processes MessagesEn.php aliases under an !isset($keepAlias[...]) guard, which silently drops any attempt to repoint an already-canonical alias string. Special:AllMyUploads would continue routing to SpecialAllMyUploads unchanged. MyFiles and Myuploads are already correctly registered and unaffected.
  1. Moving AllMyFiles to Myuploads looks like a regression. AllMyFiles is not in CORE_LIST and has no canonical self-alias protection. It currently resolves to SpecialAllMyUploads (and thus forces ilshowall=1) because it is the second element of 'AllMyUploads' => [ 'AllMyUploads', 'AllMyFiles' ] in MessagesEn.php. As a Myuploads alias it would resolve to SpecialMyuploads instead, losing the forced ilshowall=1 default. Special:AllMyFiles would silently stop showing old/superseded file revisions.

If this is right, true consolidation would require deregistering SpecialAllMyUploads from CORE_LIST, folding the ilshowall=1 behaviour into SpecialMyuploads, and updating the alias arrays, a multi-step change touching routing behaviour, not just message aliases. Should this be rescoped to that larger change, or is preserving the "force all revisions by default" distinction the intended outcome? Happy to be corrected; I read the source but haven't tested on a live install.

(Researched with AI assistance.)