Merge "mediawiki.api.watch: Use formatversion=2 for API requests"
authorjenkins-bot <jenkins-bot@gerrit.wikimedia.org>
Sat, 17 Dec 2016 06:55:58 +0000 (06:55 +0000)
committerGerrit Code Review <gerrit@wikimedia.org>
Sat, 17 Dec 2016 06:55:58 +0000 (06:55 +0000)
resources/src/mediawiki/api/watch.js
resources/src/mediawiki/page/watch.js

index 92722b5..f68697f 100644 (file)
@@ -26,6 +26,7 @@
                var apiPromise = this.postWithToken( 'watch',
                        $.extend(
                                {
+                                       formatversion: 2,
                                        action: 'watch',
                                        titles: $.isArray( pages ) ? pages.join( '|' ) : String( pages ),
                                        uselang: mw.config.get( 'wgUserLanguage' )
index f880e6a..5dda7e0 100644 (file)
 
                                        // 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;