Merge "Fix checkbox handling in the API"

This commit is contained in:
jenkins-bot 2020-03-02 18:06:36 +00:00 committed by Gerrit Code Review
commit becafcdadf
4 changed files with 7 additions and 7 deletions

View file

@ -64,7 +64,7 @@
"apihelp-visualeditoredit-param-starttimestamp": "When saving, set this to the timestamp of when the page was loaded. Used to detect edit conflicts.",
"apihelp-visualeditoredit-param-summary": "Edit summary.",
"apihelp-visualeditoredit-param-tags": "Change tags to apply to the edit.",
"apihelp-visualeditoredit-param-watch": "Add the page to the current user's watchlist.",
"apihelp-visualeditoredit-param-watchlist": "{{int:apihelp-edit-param-watchlist}}",
"apihelp-visualeditoredit-param-wikitext": "The wikitext to act with.",
"apihelp-visualeditoredit-summary": "Save an HTML5 page to MediaWiki (converted to wikitext via the Parsoid service)."
}

View file

@ -73,7 +73,7 @@
"apihelp-visualeditoredit-param-starttimestamp": "{{doc-apihelp-param|visualeditoredit|starttimestamp}}",
"apihelp-visualeditoredit-param-summary": "{{doc-apihelp-param|visualeditoredit|summary}}\n{{Identical|Edit summary}}",
"apihelp-visualeditoredit-param-tags": "{{doc-apihelp-param|visualeditoredit|tags}}",
"apihelp-visualeditoredit-param-watch": "{{doc-apihelp-param|visualeditoredit|watch}}",
"apihelp-visualeditoredit-param-watchlist": "{{doc-apihelp-param|visualeditoredit|watchlist}}",
"apihelp-visualeditoredit-param-wikitext": "{{doc-apihelp-param|visualeditoredit|wikitext}}",
"apihelp-visualeditoredit-summary": "{{doc-apihelp-summary|visualeditoredit}}"
}

View file

@ -39,6 +39,7 @@ class ApiVisualEditorEdit extends ApiVisualEditor {
'basetimestamp' => $params['basetimestamp'],
'starttimestamp' => $params['starttimestamp'],
'token' => $params['token'],
'watchlist' => $params['watchlist'],
'errorformat' => 'html',
];
@ -48,9 +49,6 @@ class ApiVisualEditorEdit extends ApiVisualEditor {
$apiParams['notminor'] = true;
}
// FIXME add some way that the user's preferences can be respected
$apiParams['watchlist'] = $params['watch'] ? 'watch' : 'unwatch';
if ( $params['captchaid'] ) {
$apiParams['captchaid'] = $params['captchaid'];
}
@ -533,7 +531,7 @@ class ApiVisualEditorEdit extends ApiVisualEditor {
'starttimestamp' => null,
'oldid' => null,
'minor' => null,
'watch' => null,
'watchlist' => null,
'html' => null,
'etag' => null,
'summary' => null,

View file

@ -1435,7 +1435,7 @@ ve.init.mw.ArticleTarget.prototype.getSaveOptions = function () {
fieldMap = {
wpSummary: 'summary',
wpMinoredit: 'minor',
wpWatchthis: 'watch',
wpWatchthis: 'watchlist',
wpCaptchaId: 'captchaid',
wpCaptchaWord: 'captchaword'
};
@ -1447,6 +1447,8 @@ ve.init.mw.ArticleTarget.prototype.getSaveOptions = function () {
}
}
options.watchlist = 'watchlist' in options ? 'watch' : 'unwatch';
return options;
};