From: Bartosz DziewoƄski Date: Fri, 14 Mar 2014 18:06:23 +0000 (+0100) Subject: mediawiki.api.category: Deprecate getCategories() 'async' parameter X-Git-Tag: 1.31.0-rc.0~16437^2 X-Git-Url: http://git.cyclocoop.org/%40spipnet%40?a=commitdiff_plain;h=bdf3abd7199992ad05d34c7b53ee087c9c46bf29;p=lhc%2Fweb%2Fwiklou.git mediawiki.api.category: Deprecate getCategories() 'async' parameter One should never set it to anything other than the default value. Change-Id: I6d191916f14aa29a04b2190debe9901032629938 --- diff --git a/RELEASE-NOTES-1.23 b/RELEASE-NOTES-1.23 index cea7f69673..ff7b5f9a67 100644 --- a/RELEASE-NOTES-1.23 +++ b/RELEASE-NOTES-1.23 @@ -318,6 +318,7 @@ changes to languages because of Bugzilla reports. parser, where it differs from the PHP parser). * Special:Search no longer has an "include redirects" option on the advanced tab. Redirects are now included in all searches. +* mediawiki.api.category's getCategories() 'async' parameter was deprecated. ==== Removed classes ==== * FakeMemCachedClient (deprecated in 1.18) diff --git a/resources/mediawiki.api/mediawiki.api.category.js b/resources/mediawiki.api/mediawiki.api.category.js index 7435e04439..a90617d8ad 100644 --- a/resources/mediawiki.api/mediawiki.api.category.js +++ b/resources/mediawiki.api/mediawiki.api.category.js @@ -21,7 +21,6 @@ titles: String( title ) } ); - // Backwards compatibility (< MW 1.20) if ( ok || err ) { mw.track( 'mw.deprecate', 'api.cbParam' ); mw.log.warn( msg ); @@ -64,7 +63,6 @@ apnamespace: mw.config.get( 'wgNamespaceIds' ).category } ); - // Backwards compatibility (< MW 1.20) if ( ok || err ) { mw.track( 'mw.deprecate', 'api.cbParam' ); mw.log.warn( msg ); @@ -91,7 +89,7 @@ * @param {mw.Title|string} title * @param {Function} [ok] Success callback (deprecated) * @param {Function} [err] Error callback (deprecated) - * @param {boolean} [async=true] Asynchronousness + * @param {boolean} [async=true] Asynchronousness (deprecated) * @return {jQuery.Promise} * @return {Function} return.done * @return {boolean|mw.Title[]} return.done.categories List of category titles or false @@ -105,11 +103,17 @@ async: async === undefined ? true : async } ); - // Backwards compatibility (< MW 1.20) if ( ok || err ) { mw.track( 'mw.deprecate', 'api.cbParam' ); mw.log.warn( msg ); } + if ( async !== undefined ) { + mw.track( 'mw.deprecate', 'api.async' ); + mw.log.warn( + 'Use of mediawiki.api async=false param is deprecated. ' + + 'The sychronous mode will be removed in the future.' + ); + } return apiPromise .then( function ( data ) {