mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/VisualEditor
synced 2024-11-28 00:00:49 +00:00
Do not define contradictory user preferences for enabling/disabling VE
Depending on the config, we would sometimes define both the 'visualeditor-enable' and the 'visualeditor-betatempdisable' preferences, even though they contradict each other. Bug: T273188 Change-Id: I6ac7e4580bf232a5198ad8842f814bc381131e00
This commit is contained in:
parent
b1fa5839c4
commit
4b1f141511
|
@ -758,7 +758,10 @@ class VisualEditorHooks {
|
||||||
$veConfig = MediaWikiServices::getInstance()->getConfigFactory()
|
$veConfig = MediaWikiServices::getInstance()->getConfigFactory()
|
||||||
->makeConfig( 'visualeditor' );
|
->makeConfig( 'visualeditor' );
|
||||||
|
|
||||||
if ( !ExtensionRegistry::getInstance()->isLoaded( 'BetaFeatures' ) ) {
|
if (
|
||||||
|
$veConfig->get( 'VisualEditorEnableBetaFeature' ) &&
|
||||||
|
!ExtensionRegistry::getInstance()->isLoaded( 'BetaFeatures' )
|
||||||
|
) {
|
||||||
// Config option for visual editing "alpha" state (no Beta Feature)
|
// Config option for visual editing "alpha" state (no Beta Feature)
|
||||||
$namespaces = ApiVisualEditor::getAvailableNamespaceIds( $veConfig );
|
$namespaces = ApiVisualEditor::getAvailableNamespaceIds( $veConfig );
|
||||||
|
|
||||||
|
@ -780,14 +783,16 @@ class VisualEditorHooks {
|
||||||
$preferences['visualeditor-enable'] = $visualEnablePreference;
|
$preferences['visualeditor-enable'] = $visualEnablePreference;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Config option for visual editing "deployed" state (opt-out)
|
if ( !$veConfig->get( 'VisualEditorEnableBetaFeature' ) ) {
|
||||||
$preferences['visualeditor-betatempdisable'] = [
|
// Config option for visual editing "deployed" state (opt-out)
|
||||||
'type' => 'toggle',
|
$preferences['visualeditor-betatempdisable'] = [
|
||||||
'label-message' => 'visualeditor-preference-betatempdisable',
|
'type' => 'toggle',
|
||||||
'section' => 'editing/editor',
|
'label-message' => 'visualeditor-preference-betatempdisable',
|
||||||
'default' => $user->getOption( 'visualeditor-betatempdisable' ) ||
|
'section' => 'editing/editor',
|
||||||
$user->getOption( 'visualeditor-autodisable' )
|
'default' => $user->getOption( 'visualeditor-betatempdisable' ) ||
|
||||||
];
|
$user->getOption( 'visualeditor-autodisable' )
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
// Config option for wikitext editing "deployed" state (opt-out)
|
// Config option for wikitext editing "deployed" state (opt-out)
|
||||||
if (
|
if (
|
||||||
|
|
Loading…
Reference in a new issue