Page MenuHomePhabricator

FOUC when loading Special:Preferences, seemingly caused by GlobalPreferences
Closed, ResolvedPublic

Description

This checkbox is briefly visible while the page is loading:

Event Timeline

Esanders created this task.Feb 13 2019, 1:40 PM
Restricted Application added a project: Community-Tech. · View Herald TranscriptFeb 13 2019, 1:40 PM
Restricted Application added a subscriber: Aklapper. · View Herald Transcript

@Esanders You see this checkbox on Special:Preferences? That's very surprising. GlobalPreferences UI should only load on Special:GlobalPreferences.

Can you tell me which wiki you tried this on? I couldn't reproduce on enwiki.

Yes, this is on en.wiki, or any other wiki for that matter (just tested on it.wiki).

Can't see it on my staff account though, so could be specific to a user setting I have.

I also see it on my dev environment.

I can reproduce it working and not working locally with different accounts. The code that generates the checkbox is in this loop, which runs even on the local preferences page:

foreach ( $preferences as $name => $def ) {
	$modifiedPrefs[$name] = $def;
	// If this has been set globally.
	if ( in_array( $name, $globalPrefNames ) ) {

When this condition passes on my account which is "broken" the preference $name is cx-new-version and $globalPrefNames is ['cx-invite-chosen', 'cx-new-version'].

I'd guess the issue here is my account has old preferences set for controls that no longer exist, so the code needs to check the controls still exist?

Change 494918 had a related patch set uploaded (by Esanders; owner: Esanders):
[mediawiki/extensions/GlobalPreferences@master] Don't show local-exception checkbox if there is no control

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

Change 494918 merged by jenkins-bot:
[mediawiki/extensions/GlobalPreferences@master] Don't show local-exception checkbox if there is no control

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

Jdforrester-WMF closed this task as Resolved.Mar 22 2019, 6:48 PM
Jdforrester-WMF assigned this task to Esanders.