Jforrester has uploaded a new change for review. https://gerrit.wikimedia.org/r/132736
Change subject: Follow-up Ica9e5a9284: Actually make visualeditor-hidebetawelcome work ...................................................................... Follow-up Ica9e5a9284: Actually make visualeditor-hidebetawelcome work Three 'minor' points: * You have to declare even hidden preferences. Whoops. * There's no such thing as an "optionsToken", use "editToken". * You need to POST action=options API calls. Ahem. Change-Id: I9c4358107af7bcfca157bd014de49882914e990c --- M VisualEditor.hooks.php M modules/ve-mw/init/targets/ve.init.mw.ViewPageTarget.js 2 files changed, 5 insertions(+), 2 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/VisualEditor refs/changes/36/132736/1 diff --git a/VisualEditor.hooks.php b/VisualEditor.hooks.php index 68b1165..50400b1 100644 --- a/VisualEditor.hooks.php +++ b/VisualEditor.hooks.php @@ -279,6 +279,9 @@ 'label-message' => 'visualeditor-preference-betatempdisable', 'section' => 'editing/editor' ); + $preferences['visualeditor-hidebetawelcome'] = array( + 'type' => 'api' + ); return true; } diff --git a/modules/ve-mw/init/targets/ve.init.mw.ViewPageTarget.js b/modules/ve-mw/init/targets/ve.init.mw.ViewPageTarget.js index 59206b7..bcc2415 100644 --- a/modules/ve-mw/init/targets/ve.init.mw.ViewPageTarget.js +++ b/modules/ve-mw/init/targets/ve.init.mw.ViewPageTarget.js @@ -1580,9 +1580,9 @@ if ( prefSaysShow ) { ve.init.mw.Target.static.apiRequest( { 'action': 'options', - 'token': mw.user.tokens.get( 'optionsToken' ), + 'token': mw.user.tokens.get( 'editToken' ), 'change': 'visualeditor-hidebetawelcome=1' - } ); + }, 'POST' ); // No need to set a cookie every time for logged-in users that have already // set the hidebetawelcome=1 preference, but only if this isn't a one-off -- To view, visit https://gerrit.wikimedia.org/r/132736 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I9c4358107af7bcfca157bd014de49882914e990c Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/VisualEditor Gerrit-Branch: master Gerrit-Owner: Jforrester <jforres...@wikimedia.org> _______________________________________________ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits