Deprecate $wgUseAjax, act as always-true
authorJames D. Forrester <jforrester@wikimedia.org>
Thu, 22 Mar 2018 21:27:45 +0000 (14:27 -0700)
committerKrinkle <krinklemail@gmail.com>
Wed, 18 Apr 2018 00:50:45 +0000 (00:50 +0000)
Change-Id: Ia224c7ea1f902714e2c11bdebb9dadcd1ddfe43f

RELEASE-NOTES-1.32
includes/DefaultSettings.php
includes/MediaWiki.php
includes/skins/Skin.php
includes/specials/forms/UploadForm.php

index d8eb2e2..9018c11 100644 (file)
@@ -7,6 +7,7 @@ production.
 
 === Configuration changes in 1.32 ===
 * (T115414) The $wgEnableAPI and $wgEnableWriteAPI settings, deprecated in 1.31, have been removed.
+* The $wgUseAjax setting is now formally deprecated, and MediaWiki will act as if it is always set.
 * …
 
 === New features in 1.32 ===
index 8ddf310..f34b00a 100644 (file)
@@ -8182,6 +8182,8 @@ $wgAPIUselessQueryPages = [
 
 /**
  * Enable AJAX framework
+ *
+ * @deprecated since MediaWiki 1.32 and ignored
  */
 $wgUseAjax = true;
 
index b3abe7c..82ffcfb 100644 (file)
@@ -758,7 +758,7 @@ class MediaWiki {
                $request = $this->context->getRequest();
 
                // Send Ajax requests to the Ajax dispatcher.
-               if ( $this->config->get( 'UseAjax' ) && $request->getVal( 'action' ) === 'ajax' ) {
+               if ( $request->getVal( 'action' ) === 'ajax' ) {
                        // Set a dummy title, because $wgTitle == null might break things
                        $title = Title::makeTitle( NS_SPECIAL, 'Badtitle/performing an AJAX call in '
                                . __METHOD__
index 80a1f6e..f3276e8 100644 (file)
@@ -171,8 +171,6 @@ abstract class Skin extends ContextSource {
         * @return array Array of modules with helper keys for easy overriding
         */
        public function getDefaultModules() {
-               global $wgUseAjax;
-
                $out = $this->getOutput();
                $config = $this->getConfig();
                $user = $out->getUser();
@@ -217,17 +215,15 @@ abstract class Skin extends ContextSource {
                }
 
                // Add various resources if required
-               if ( $wgUseAjax ) {
-                       if ( $user->isLoggedIn()
-                               && $user->isAllowedAll( 'writeapi', 'viewmywatchlist', 'editmywatchlist' )
-                               && $this->getRelevantTitle()->canExist()
-                       ) {
-                               $modules['watch'][] = 'mediawiki.page.watch.ajax';
-                       }
-
-                       $modules['search'][] = 'mediawiki.searchSuggest';
+               if ( $user->isLoggedIn()
+                       && $user->isAllowedAll( 'writeapi', 'viewmywatchlist', 'editmywatchlist' )
+                       && $this->getRelevantTitle()->canExist()
+               ) {
+                       $modules['watch'][] = 'mediawiki.page.watch.ajax';
                }
 
+               $modules['search'][] = 'mediawiki.searchSuggest';
+
                if ( $user->getBoolOption( 'editsectiononrightclick' ) ) {
                        $modules['user'][] = 'mediawiki.action.view.rightClickEdit';
                }
index a316374..e561fe5 100644 (file)
@@ -406,13 +406,11 @@ class UploadForm extends HTMLForm {
        protected function addUploadJS() {
                $config = $this->getConfig();
 
-               $useAjaxDestCheck = $config->get( 'UseAjax' ) && $config->get( 'AjaxUploadDestCheck' );
-               $useAjaxLicensePreview = $config->get( 'UseAjax' ) && $config->get( 'AjaxLicensePreview' );
                $this->mMaxUploadSize['*'] = UploadBase::getMaxUploadSize();
 
                $scriptVars = [
-                       'wgAjaxUploadDestCheck' => $useAjaxDestCheck,
-                       'wgAjaxLicensePreview' => $useAjaxLicensePreview,
+                       'wgAjaxUploadDestCheck' => $config->get( 'AjaxUploadDestCheck' ),
+                       'wgAjaxLicensePreview' => $config->get( 'AjaxLicensePreview' ),
                        'wgUploadAutoFill' => !$this->mForReUpload &&
                                // If we received mDestFile from the request, don't autofill
                                // the wpDestFile textbox