mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/AbuseFilter.git
synced 2024-11-27 15:30:42 +00:00
82b6f191d4
Setting 'apiHookResult' results in a "successful" response; if we want to report an error, we need to use ApiMessage. We already were doing this for action=upload. Now our action=edit API responses will be consistent with MediaWiki and other extensions, and will be able to take advantage of errorformat=html. Since this breaks compatibility anyway, also remove some redundant backwards-compatibility values from the output. To avoid user interface regressions in VisualEditor, the changes I3b9c4fef (in VE) and I106dbd3c (in MediaWiki) should be merged first. Before: { "edit": { "code": "abusefilter-disallowed", "message": { "key": "abusefilter-disallowed", "params": [ ... ] }, "abusefilter": { ... }, "info": "Hit AbuseFilter: Test filter disallow", "warning": "This action has been automatically identified ...", "result": "Failure" } } After: { "errors": [ { "code": "abusefilter-disallowed", "data": { "abusefilter": { ... }, }, "module": "edit", "*": "This action has been automatically identified ..." } ], "*": "See http://localhost:3080/w/api.php for API usage. ..." } For comparison, a 'readonly' error: { "errors": [ { "code": "readonly", "data": { "readonlyreason": "foo bar" }, "module": "main", "*": "The wiki is currently in read-only mode." } ], "*": "See http://localhost:3080/w/api.php for API usage. ..." } Bug: T229539 Depends-On: I106dbd3cbdbf7082b1d1f1c1106ece6b19c22a86 Depends-On: I3b9c4fefc0869ef7999c21cef754434febd852ec Change-Id: I5424de387cbbcc9c85026b8cfeaf01635eee34a0 |
||
---|---|---|
.. | ||
ve-abusefilter | ||
ext.abuseFilter.css | ||
ext.abuseFilter.edit.js | ||
ext.abuseFilter.examine.js | ||
ext.abuseFilter.tools.js | ||
mode-abusefilter.js | ||
red_x.png | ||
yes_check.png |