mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/VisualEditor
synced 2024-11-15 10:35:48 +00:00
Merge "Ignore user prefs for enabling/disabling VE which are not settable"
This commit is contained in:
commit
6392fda0f0
|
@ -238,8 +238,13 @@ class VisualEditorHooks {
|
|||
* @return bool
|
||||
*/
|
||||
private static function enabledForUser( $user ) {
|
||||
return $user->getOption( 'visualeditor-enable' ) &&
|
||||
!$user->getOption( 'visualeditor-betatempdisable' ) &&
|
||||
$veConfig = MediaWikiServices::getInstance()->getConfigFactory()
|
||||
->makeConfig( 'visualeditor' );
|
||||
$isBeta = $veConfig->get( 'VisualEditorEnableBetaFeature' );
|
||||
|
||||
return ( $isBeta ?
|
||||
$user->getOption( 'visualeditor-enable' ) :
|
||||
!$user->getOption( 'visualeditor-betatempdisable' ) ) &&
|
||||
!$user->getOption( 'visualeditor-autodisable' );
|
||||
}
|
||||
|
||||
|
@ -1006,6 +1011,7 @@ class VisualEditorHooks {
|
|||
$vars['wgVisualEditorConfig'] = [
|
||||
'usePageImages' => $extensionRegistry->isLoaded( 'PageImages' ),
|
||||
'usePageDescriptions' => $extensionRegistry->isLoaded( 'WikibaseClient' ),
|
||||
'isBeta' => $veConfig->get( 'VisualEditorEnableBetaFeature' ),
|
||||
'disableForAnons' => $veConfig->get( 'VisualEditorDisableForAnons' ),
|
||||
'preloadModules' => $veConfig->get( 'VisualEditorPreloadModules' ),
|
||||
'preferenceModules' => $veConfig->get( 'VisualEditorPreferenceModules' ),
|
||||
|
|
|
@ -1174,7 +1174,7 @@
|
|||
// User has 'visualeditor-enable' preference enabled (for alpha opt-in)
|
||||
// User has 'visualeditor-betatempdisable' preference disabled
|
||||
// User has 'visualeditor-autodisable' preference disabled
|
||||
enable && !tempdisable && !autodisable
|
||||
( conf.isBeta ? enable : !tempdisable ) && !autodisable
|
||||
);
|
||||
|
||||
// Duplicated in VisualEditor.hooks.php#isVisualAvailable()
|
||||
|
|
Loading…
Reference in a new issue