Page MenuHomePhabricator

Migrate the 'visualeditor-enable' and 'visualeditor-betatempdisable' preferences to a single one
Open, Needs TriagePublic

Description

When VisualEditorUnifiedPreference is true, VisualEditor uses two different preferences, depending on how the integration with BetaFeatures was configured historically:

  • When VisualEditorEnableBetaFeature is true, 'visualeditor-enable' is used (true means VE is enabled)
  • When VisualEditorEnableBetaFeature is false, 'visualeditor-betatempdisable' is used (false means VE is enabled)

This is bad for two reasons:

  • It makes the preferences code quite a bit more complicated. More complicated code provides more opportunities to break something. https://www.mediawiki.org/wiki/Just_make_it_a_user_preference#Difficulties, points 1, 6 and 7 apply, but without the benefit of actually providing more options to users.
  • It makes it harder to set global preferences. How to enable/disable VE on all projects (by setting visualeditor-enable = 1, visualeditor-betatempdisable = 0 or visualeditor-enable = 0, visualeditor-betatempdisable = 1) if there is no single project where both appear on Special:GlobalPreferences?

We should make it use just one preference name (either 'visualeditor-enable' or a new one, if that makes migration easier) and write and run a maintenance script to update the entries in the databases to also use that name. The maintenance script will also need to update global preferences somehow.

This may be easier to do after T344757 and T344760 are done, so that there are less weird edge cases to consider.