diff --git a/includes/Hooks.php b/includes/Hooks.php index fa93ec34..d9d7a3cb 100644 --- a/includes/Hooks.php +++ b/includes/Hooks.php @@ -449,13 +449,15 @@ class Hooks { */ public static function onLocalUserCreated( User $user, $isAutoCreated ) { $default = self::getConfig( Constants::CONFIG_KEY_DEFAULT_SKIN_VERSION_FOR_NEW_ACCOUNTS ); - $optionsManager = MediaWikiServices::getInstance()->getUserOptionsManager(); - $optionsManager->setOption( - $user, - Constants::PREF_KEY_SKIN, - $default === Constants::SKIN_VERSION_LEGACY ? - Constants::SKIN_NAME_LEGACY : Constants::SKIN_NAME_MODERN - ); + if ( $default ) { + $optionsManager = MediaWikiServices::getInstance()->getUserOptionsManager(); + $optionsManager->setOption( + $user, + Constants::PREF_KEY_SKIN, + $default === Constants::SKIN_VERSION_LEGACY ? + Constants::SKIN_NAME_LEGACY : Constants::SKIN_NAME_MODERN + ); + } } /** diff --git a/skin.json b/skin.json index b6918999..eba78e3c 100644 --- a/skin.json +++ b/skin.json @@ -411,8 +411,8 @@ "description": "@var string:['2'|'1'] The version ('2' for latest, '1' for legacy) of the Vector skin to use when an existing user has not specified a preference. This configuration is not used for new accounts (see VectorDefaultSkinVersionForNewAccounts) and is impermanent. In the future, this field may contains versions such as \"beta\" which when specified and the BetaFeatures extension is installed, and the user is enrolled, the latest version is used otherwise legacy. The value is _not_ persisted." }, "VectorDefaultSkinVersionForNewAccounts": { - "value": "1", - "description": "@var string:['2'|'1'] The version ('2' for latest, '1' for legacy) of the Vector skin to **set** for newly created user accounts. **The value is persisted as a user preference.** This configuration is not used for preexisting accounts (see VectorDefaultSkinVersionForExistingAccounts) and only ever executed once at new account creation time." + "value": null, + "description": "@var string|null The version ('2' for latest, '1' for legacy) of the Vector skin to **set** for newly created user accounts. **The value is persisted as a user preference.** This configuration is not used for preexisting accounts (see VectorDefaultSkinVersionForExistingAccounts) and only ever executed once at new account creation time. If it is null, no user preference will be set." }, "VectorWvuiSearchOptions": { "value": {