Page MenuHomePhabricator

Language button is not always clickable due to ext.uls.interface module being loaded on pages it is not used
Open, Needs TriagePublicBUG REPORT

Description

List of steps to reproduce (step by step, including full links if applicable):

  1. Log in
  2. In Special:Preferences disable the compact languages link feature like so:

Screen Shot 2021-07-22 at 9.35.48 AM.png (228×1 px, 39 KB)

  1. Visit https://de.wikipedia.org/wiki/Berlin
  2. Click the language button

Screen Shot 2021-07-22 at 9.38.30 AM.png (292×532 px, 35 KB)

What happens?:

Most of the time the language dropdown shows like so:

Screen Shot 2021-07-22 at 9.38.53 AM.png (1×608 px, 83 KB)

However, occasionally no menu will show like so:

Screen Shot 2021-07-22 at 9.39.19 AM.png (298×506 px, 43 KB)

I was able to replicate this 1 / 10 times.

Software version (if not a Wikimedia wiki), browser information, screenshots, other information, etc:

Issue occurred on German Wikipedia.

The following gadgets are enabled:

Screen Shot 2021-07-22 at 9.36.11 AM.png (166×1 px, 63 KB)

Screen Shot 2021-07-22 at 9.36.40 AM.png (120×1 px, 38 KB)

Screen Shot 2021-07-22 at 9.36.54 AM.png (76×1 px, 20 KB)

The Content Translation beta feature is enabled.

I was unable to replicate on https://de.wikipedia.org/wiki/Berlin?safemode=1

Developer notes

It's possible the class vector-menu--hide-dropdown is related.

Inspecting the code this class is removed if the module ext.uls.interface is being loaded. Presumably a race condition exists where some code loads that module.

https://gerrit.wikimedia.org/g/mediawiki/skins/Vector/+/b621b3836f9d2396e379e11cd1d788984c7f3d00/resources/skins.vector.js/languageButton.js#6

Event Timeline

ext.uls.interface is never loaded by any module as a dependency from looking at code search.
This suggests https://gerrit.wikimedia.org/g/mediawiki/extensions/UniversalLanguageSelector/+/5a7a6a5fe30e2e64119c134e7dca7d737a0d4fe3/includes/UniversalLanguageSelectorHooks.php#135 is what loads it.

Something looks off with this logic. Both ULSEnableAnon and ULSEnable are true by default, but this function does not consider the preferences setting that requests that the code is never loaded.

@Nikerabbit @santhosh is there a reason this module is always loaded?

Perhaps Vector needs to also check the value of mw.config.get( 'wgULSisCompactLinksEnabled' ) if that behaviour is correct.

Both ULSEnableAnon and ULSEnable are true by default, but this function does not consider the preferences setting that requests that the code is never loaded.

Those two variables should probably be removed altogether.

There is no preference setting for disabling ULS. We expanded the scope of "disable compact language links" to "disable new vector language selector". It does not make sense to expand it further to "disable uls". I think you want to check that variables whether ULS attaches itself to the new language selector, as that is what ULS does: https://gerrit.wikimedia.org/g/mediawiki/extensions/UniversalLanguageSelector/+/01c7a4fb0b0cb788c5266aebe9388612c49ba20c/resources/js/ext.uls.interface.js#526