=== 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 ===
/**
* Enable AJAX framework
+ *
+ * @deprecated since MediaWiki 1.32 and ignored
*/
$wgUseAjax = true;
$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__
* @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();
}
// 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';
}
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