With formatversion=2 the JSON response uses UTF-8 instead of escape sequences
with hex for encoding of non-ASCII characters (e.g. "\u00e4" for "รค").
formatversion=2 has a different syntax for boolean values:
formatversion=1: "watched": ""
formatversion=2: "watched": true
Consumers of this API that process the response with
response.watched === ''
must change this to
response.watched === true
Change-Id: I087ab538b9400d774f8c2c6a8c0f55a33fab6044
var apiPromise = this.postWithToken( 'watch',
$.extend(
{
+ formatversion: 2,
action: 'watch',
titles: $.isArray( pages ) ? pages.join( '|' ) : String( pages ),
uselang: mw.config.get( 'wgUserLanguage' )
// Update the "Watch this page" checkbox on action=edit when the
// page is watched or unwatched via the tab (bug 12395).
- $( '#wpWatchthis' ).prop( 'checked', watchResponse.watched !== undefined );
+ $( '#wpWatchthis' ).prop( 'checked', watchResponse.watched === true );
} )
.fail( function () {
var cleanTitle, msg, link;