diff --git a/RELEASE-NOTES-1.38 b/RELEASE-NOTES-1.38 index 70739fd36a2..e267dcd4d5b 100644 --- a/RELEASE-NOTES-1.38 +++ b/RELEASE-NOTES-1.38 @@ -19,6 +19,7 @@ Some specific notes for MediaWiki 1.38 upgrades are below: For notes on 1.36.x and older releases, see HISTORY. === Configuration changes for system administrators in 1.38 === +* Deprecate $wgAjaxUploadDestCheck, act as always-true * … ==== New configuration ==== diff --git a/includes/DefaultSettings.php b/includes/DefaultSettings.php index 51ab0afc496..232e2eadbdc 100644 --- a/includes/DefaultSettings.php +++ b/includes/DefaultSettings.php @@ -9372,6 +9372,8 @@ $wgAPIUselessQueryPages = [ /** * Enable AJAX check for file overwrite, pre-upload + * + * @deprecated since MediaWiki 1.38 and ignored */ $wgAjaxUploadDestCheck = true; diff --git a/includes/specials/forms/UploadForm.php b/includes/specials/forms/UploadForm.php index 792c6575ed1..4cf336187f6 100644 --- a/includes/specials/forms/UploadForm.php +++ b/includes/specials/forms/UploadForm.php @@ -445,7 +445,6 @@ class UploadForm extends HTMLForm { $this->mMaxUploadSize['*'] = UploadBase::getMaxUploadSize(); $scriptVars = [ - 'wgAjaxUploadDestCheck' => $config->get( 'AjaxUploadDestCheck' ), 'wgAjaxLicensePreview' => $config->get( 'AjaxLicensePreview' ), 'wgUploadAutoFill' => !$this->mForReUpload && // If we received mDestFile from the request, don't autofill diff --git a/resources/src/mediawiki.special.upload/upload.js b/resources/src/mediawiki.special.upload/upload.js index 4ec776bdd24..9e184346863 100644 --- a/resources/src/mediawiki.special.upload/upload.js +++ b/resources/src/mediawiki.special.upload/upload.js @@ -10,7 +10,6 @@ ( function () { var uploadWarning, uploadTemplatePreview, - ajaxUploadDestCheck = mw.config.get( 'wgAjaxUploadDestCheck' ), NS_FILE = mw.config.get( 'wgNamespaceIds' ).file, $license = $( '#wpLicense' ); @@ -22,9 +21,6 @@ timeoutID: false, checkNow: function ( fname ) { - if ( !ajaxUploadDestCheck ) { - return; - } if ( this.timeoutID ) { clearTimeout( this.timeoutID ); } @@ -34,7 +30,7 @@ timeout: function () { var $spinnerDestCheck, title; - if ( !ajaxUploadDestCheck || this.nameToCheck.trim() === '' ) { + if ( this.nameToCheck.trim() === '' ) { return; } $spinnerDestCheck = $.createSpinner().insertAfter( '#wpDestFile' ); @@ -132,23 +128,20 @@ }; $( function () { - // AJAX wpDestFile warnings - if ( ajaxUploadDestCheck ) { - // Insert an event handler that fetches upload warnings when wpDestFile - // has been changed - $( '#wpDestFile' ).on( 'change', function () { - uploadWarning.checkNow( $( this ).val() ); - } ); - // Insert a row where the warnings will be displayed just below the - // wpDestFile row - $( '#mw-htmlform-description tbody' ).append( - $( '