diff --git a/MultimediaViewer.php b/MultimediaViewer.php index 3848f1a83..dd484bfd8 100644 --- a/MultimediaViewer.php +++ b/MultimediaViewer.php @@ -676,13 +676,10 @@ call_user_func( function() { $wgAutoloadClasses['MultimediaViewerHooks'] = __DIR__ . '/MultimediaViewerHooks.php'; - if ( $wgMediaViewerIsInBeta ) { - $wgHooks['GetBetaFeaturePreferences'][] = 'MultimediaViewerHooks::getBetaPreferences'; - } - $wgDefaultUserOptions['multimediaviewer-enable'] = true; $wgHooks['GetPreferences'][] = 'MultimediaViewerHooks::getPreferences'; + $wgHooks['GetBetaFeaturePreferences'][] = 'MultimediaViewerHooks::getBetaPreferences'; $wgHooks['BeforePageDisplay'][] = 'MultimediaViewerHooks::getModulesForArticle'; $wgHooks['CategoryPageView'][] = 'MultimediaViewerHooks::getModulesForCategory'; $wgHooks['ResourceLoaderGetConfigVars'][] = 'MultimediaViewerHooks::resourceLoaderGetConfigVars'; diff --git a/MultimediaViewerHooks.php b/MultimediaViewerHooks.php index b459e50b5..f45632d5a 100644 --- a/MultimediaViewerHooks.php +++ b/MultimediaViewerHooks.php @@ -102,7 +102,11 @@ class MultimediaViewerHooks { // Add a beta preference to gate the feature public static function getBetaPreferences( $user, &$prefs ) { - global $wgExtensionAssetsPath; + global $wgExtensionAssetsPath, $wgMediaViewerIsInBeta; + + if ( !$wgMediaViewerIsInBeta ) { + return true; + } $prefs['multimedia-viewer'] = array( 'label-message' => 'multimediaviewer-pref',