mediawiki-skins-Vector/tests/phpunit/integration
Sam Smith 4449235516 [Special:Preferences] [PHP] Add HTMLSkinVersionField form field
I177dad88 introduced the skin version user preference field and
associated configuration values. Per T242381, the field is to presented
as a checkbox with the implied storage type of a boolean where a string
is needed. A PreferencesFormPreSave hook handler was added to adapt
values of either data type to the other.  While this was a neat solution
to a minor nit, the adapter's implementation is incompatible with the
GlobalPreferences extension as the PreferencesFormPreSave hook isn't run
whilst saving global preferences.

Rather than adding an equivalent hook to the GlobalPreferences
extension, create a custom field based on a checkbox with the adapter
included. This allows us to:

- Separate the business logic concerned with preserving the user's
  VectorSkinVersion preference if they've simply disabled Vector from
  the adapter

- Simplify the adapter's implementation

- Forego adding hooks to the GlobalPreferences codebase

Additional changes:

- Replace repeated string literals with equivalent constants in
  tests/phpunit/integration/VectorHooksTest.php

Bug: T258493
Change-Id: I628435a4ad676f55534191b8c10147be28be5d73
2020-08-31 12:04:12 -07:00
..
FeatureManagement/Requirements [fix] "Existing account only" skin version config 2020-04-29 18:36:03 +00:00
HTMLForm/Fields [Special:Preferences] [PHP] Add HTMLSkinVersionField form field 2020-08-31 12:04:12 -07:00
SkinVectorTest.php Refactor: Replace PHP complexity with JS simplicity 2020-07-31 22:15:08 +00:00
SkinVersionLookupTest.php [fix] "Existing account only" skin version config 2020-04-29 18:36:03 +00:00
VectorHooksTest.php [Special:Preferences] [PHP] Add HTMLSkinVersionField form field 2020-08-31 12:04:12 -07:00