Page MenuHomePhabricator

[Bug] Additional checkbox appearing in global preferences page
Closed, DuplicatePublic

Description

Steps to reproduce

  1. Go to https://en.wikipedia.org/wiki/Special:GlobalPreferences
  2. Go to appearance tab

Expected:

  • only one set of checkboxes appears

Observed:

  • one set of checkboxes (2 at top) and a single checkbox below

Event Timeline

Jdlrobson added a subscriber: Jdlrobson.

Although I agree the UI is problematic (T188424), I believe this is how global preferences works ? One checkbox is for the global preference and one for the local.

This was changed to current style some two years ago: T188358

The point is what the second lonely checkbox is for.

My comment was about the side-by-side appearance of the checkboxes, which is what @Jdlrobson commented about T258581#6334115.

The second lonely checkbox is the global pair for the MonoBook sub-preference (which will be toggled by JS the moment MonoBook is selected from the main prefs). The reason why the first checkbox does not appear to be lonely now is because when this screenshot was taken the user selected skin was Vector. If the selection is moved to MonoBook, its sub-pref will claim the checkbox, and the lone one still remains for the now hidden Vector sub-pref.

If the skin selection is moved to a skin that does not have sub-pref at all, like Timeless, two lonely checkboxes will appear. (One for Vector, one for MonoBook). If JS is disabled, the checkboxes will then correctly have corresponding items (since the sub-prefs are always visible in that case).

The problem stems from MediaWiki-extensions-GlobalPreferences. The issue in this case is that the sub-prefs are generated by external clients and displayed conditionally by JS while the checkbox pairs for the global setting are generated based on the total number of the preferences that can be used as global prefs unconditionally by the GlobalPreferences extension.

To fix this, GlobalPreferences needs to be fixed to tie visibility of the global-pair checkbox to the same or similar logic that is used to update visibility of the corresponding preference item.

Good detective work @Ammarpad. This is a duplicate of T246491 then isn't it?

Change 618171 had a related patch set uploaded (by Jdlrobson; owner: Samwilson):
[mediawiki/extensions/GlobalPreferences@master] Pass hide-if through to global checkbox

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

Change 618171 merged by jenkins-bot:
[mediawiki/extensions/GlobalPreferences@master] Pass hide-if through to global checkbox

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