Page MenuHomePhabricator

Special:MyLanguage: Base page language being ignored / skipped from the language fallback chain
Closed, ResolvedPublicBUG REPORT

Description

Special:MyLanguage: Base page language being ignored / skipped from the language fallback chain.

Steps to replicate the issue (include links if applicable):

  • Base page language: zh
  • User interface language: MediaWiki internal: zh-hk; BCP 47: zh-Hant-HK
  • Subpages for base page: zh (source, bot-auto-created), en (translated)

What happens?:

Special:MyLanguage redirected to /en

What should have happened instead?:

Special:MyLanguage redirected to base page (zh)

Software version (skip for WMF-hosted wikis like Wikipedia):

  • Reported from MediaWiki 1.39.2 ( eea3e36 ), from LuciferianThomas via Telegram
  • Reproduced on MediaWiki 1.40

Other information (browser name/version, screenshots, etc.):

Event Timeline

Change 876409 had a related patch set uploaded (by Winston Sung; author: Winston Sung):

[mediawiki/core@master] SpecialMyLanguage: Fix base page being ignored from language fallback detection

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

Winston_Sung changed the task status from Open to In Progress.Apr 11 2023, 3:58 AM
Winston_Sung claimed this task.

Change 876409 merged by jenkins-bot:

[mediawiki/core@master] SpecialMyLanguage: Fix base page being ignored from language fallback detection

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

Change 900723 had a related patch set uploaded (by Winston Sung; author: Winston Sung):

[mediawiki/core@master] SpecialMyLanguage: Update language page fallback functionality

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

@Winston_Sung is there an example URL you can share that helps me understand this error? ie. URL redirects to wrong language?

@Winston_Sung is there an example URL you can share that helps me understand this error? ie. URL redirects to wrong language?

The bug is already resolved by the first patch, so nothing can be tested. This follow-up makes no change to the result, just some cleanups and comments:
The elseif ( $lang === $baseLang->getCode() ) is redundant, some IDE e.g. PhpStorm would already warn it; and $fragment is come from $base, so we can return early.

Maybe the patch should be renamed. and I agree that the commit message is too poor and didn't tell any of these.

Change 900723 merged by jenkins-bot:

[mediawiki/core@master] SpecialMyLanguage: Cleanup and add more comments

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