Page MenuHomePhabricator

Regression: Vector skin did not populate all variants option in the variant drop-down menu
Closed, ResolvedPublic

Description

After deployment of MediaWiki_1.35/wmf.30, for ALL Wikimedia Projects that utilize LanguageConverter, when the skin is set to Vector, which is the default skin, the variant drop-down menu no longer contains all language variant options. This only exists in Vector skin due to the recent refactoring of the dropdown menu (T249372). This bug does not appear in all other skin.

When not logged in

The variant drop-down menu will only display the default language variant choice, defined by $wgDefaultLanguageVariant and all of its fallback variant options.

For example:
*On Chinese Wikipedia, the LanguageConverter will only display zh-hans-cn, zh-hans, zh-hant, no-conversion.
*On Serbian Wikipedia, the LanguageConverter will only display sr-el.

When logged in

The variant drop-down menu will only display language variant choice user choice in the preference. If the user did not set their preferred language variant, the variant drop-down menu only populate the language variant defined by $wgDefaultLanguageVariant and all of its fallback variant options.

Expected

The variant drop-down menu should contain all language variants the LanguageConverter support.

Below is the original ticket description

There are 9 options in variant drop-down menu:
https://zh.wikipedia.org/w/index.php?title=Wikipedia:%E9%A6%96%E9%A1%B5&variant=zh-tw&safemode=1

  1. 不转换 (zh)
  2. 简体 (zh-hans)
  3. 繁體 (zh-hant)
  4. 大陆简体 (zh-cn)
  5. 香港繁體 (zh-hk)
  6. 澳門繁體 (zh-mo)
  7. 大马简体 (zh-my)
  8. 新加坡简体 (zh-sg)
  9. 臺灣正體 (zh-tw)


However, when I choose other variant, there are fewer options.
https://zh.wikipedia.org/w/index.php?title=Wikipedia:%E9%A6%96%E9%A1%B5&variant=zh-hk&safemode=1

Expected: Same options for all variants.

Event Timeline

There are a very large number of changes, so older changes are hidden. Show Older Changes
Restricted Application added subscribers: Cosine02, Aklapper. · View Herald TranscriptApr 30 2020, 2:03 PM

I am unable to reproduce this phenomenon. I checked all Chinese Wikimedia Project with my account logged in and with incognito option (No account logged in and no cookie).

Xiplus closed this task as Invalid.May 1 2020, 6:09 AM

The bug is disappeared.

VulpesVulpes825 moved this task from Backlog to Closed on the Chinese-Sites board.May 1 2020, 7:26 AM
SCP-2000 added a comment.EditedMay 4 2020, 10:44 PM

This issue has happened again in Chinese Wikipedia and other wikiproject, such as Wikiversity and Wikiquote.

{F31803221}现在仅显示内容语言变种设置的语言(未登录时疑似调用系统默认语言)

Since LanguageConverter is part of the core, adding Platform Engineering based on good faith. If this is an incorrect assumption, please feel free to remove the project tag.

VulpesVulpes825 renamed this task from Some options are missing from the variant drop-down menu to LanguageConverter did not populate all variants option in the variant drop-down menu.May 5 2020, 8:19 AM
VulpesVulpes825 updated the task description. (Show Details)
Restricted Application added a subscriber: Petar.petkovic. · View Herald TranscriptMay 5 2020, 8:19 AM
Xiplus reopened this task as Open.May 6 2020, 12:58 AM

Sorry for wrong operation.

daniel triaged this task as High priority.May 8 2020, 10:12 AM
daniel moved this task from Inbox to Ready on the Platform Team Workboards (Clinic Duty Team) board.
KirkLU added a subscriber: KirkLU.May 8 2020, 10:15 AM

This bug seems like a limited one. It only happens when the "Skin" in "Preferences/Appearence" is set to "Vector".

Adding Vector to reflect the new finding.

daniel added a subscriber: daniel.

Untagging CPT, assuming this is a bug in the Vector skin. Tagging the Language-Team to have a look. If this turns out to be a problem in the API or in LanguageConverter, please tag the core platform team again.

@daniel, thanks for your help. It is indeed a bug caused by the Vector skin due to the recent refactor the Vector team is doing in T249372. I will update the task description to reflect the new finding.

VulpesVulpes825 renamed this task from LanguageConverter did not populate all variants option in the variant drop-down menu to Vector skin did not populate all variants option in the variant drop-down menu.May 8 2020, 11:39 AM
VulpesVulpes825 updated the task description. (Show Details)

Change 595160 had a related patch set uploaded (by VulpesVulpes825; owner: VulpesVulpes825):
[mediawiki/skins/Vector@master] Fix: Adding back previous language varaint code before refactor

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

I'll look into this bug today.

When I visit https://zh.wikipedia.beta.wmflabs.org/wiki/Main_Page I am seeing variants just fine:

however when I click 不转换 I see a list with just one item

THe list should be similar for both - am I understanding correctly?

If so I think I think the problem is a break command (the irony!)

Change 595181 had a related patch set uploaded (by Jdlrobson; owner: Jdlrobson):
[mediawiki/skins/Vector@master] Don't "break" the variants by breaking early

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

LHPSU added a comment.May 8 2020, 2:31 PM

Clicking on any item in the menu removes all items below that one.
On some browsers, the drop-down menu does not work at all.

Change 595160 abandoned by VulpesVulpes825:
Fix: Adding back previous language varaint code before refactor

Reason:
Waiting for simpler solution or a full revert.

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

@Jdlrobson, you are right. Break contradict with the following line.

if ( isset( $item['class'] ) && stripos( $item['class'], 'selected' ) !== false )

This caused the skin stop generate variant option when a variant is selected (default is zh-cn) and stop generating all other variants. Nice job!

Jdlrobson renamed this task from Vector skin did not populate all variants option in the variant drop-down menu to Regression: Vector skin did not populate all variants option in the variant drop-down menu.May 8 2020, 3:24 PM
Jdlrobson assigned this task to Edtadros.

Change 595181 merged by jenkins-bot:
[mediawiki/skins/Vector@master] Don't "break" the variants by breaking early

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

Fix is in master. SWAT deploys are usually not allowed, so I suspect this bug will be present until Monday earliest but hopefully resolved by Thursday. Sorry about that :(

@Jdlrobson, no worries! Thanks a lot for the help and thank god that this issue is not caused by core. I will close the ticket when the patch is deployed.

Change 595536 had a related patch set uploaded (by Jdlrobson; owner: Jdlrobson):
[mediawiki/skins/Vector@wmf/1.35.0-wmf.30] Don't "break" the variants by breaking early

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

Change 595588 had a related patch set uploaded (by Jforrester; owner: Jdlrobson):
[mediawiki/skins/Vector@wmf/1.35.0-wmf.31] Don't "break" the variants by breaking early

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

Change 595588 merged by jenkins-bot:
[mediawiki/skins/Vector@wmf/1.35.0-wmf.31] Don't "break" the variants by breaking early

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

Change 595536 merged by jenkins-bot:
[mediawiki/skins/Vector@wmf/1.35.0-wmf.30] Don't "break" the variants by breaking early

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

Mentioned in SAL (#wikimedia-operations) [2020-05-11T17:24:32Z] <jforrester@deploy1001> Synchronized php-1.35.0-wmf.31/skins/Vector/includes/VectorTemplate.php: T251521 Correctly populate the language variants drop-down rather than breaking early (duration: 00m 59s)

Mentioned in SAL (#wikimedia-operations) [2020-05-11T17:27:29Z] <jforrester@deploy1001> Synchronized php-1.35.0-wmf.30/skins/Vector/includes/VectorTemplate.php: T251521 Correctly populate the language variants drop-down rather than breaking early (duration: 00m 59s)

VulpesVulpes825 closed this task as Resolved.May 11 2020, 5:27 PM
VulpesVulpes825 moved this task from MediaWiki core to Closed on the Chinese-Sites board.

@Jdlrobson, Thank you for your help. Now all options are in the variant dropdown menu when using Vector skin.

This is now deployed; leaving open for QA.