mediawiki-extensions-AbuseF.../modules
Bartosz Dziewoński 82b6f191d4 Actually return errors for action=edit API
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
2019-09-09 20:15:19 +02:00
..
ve-abusefilter Actually return errors for action=edit API 2019-09-09 20:15:19 +02:00
ext.abuseFilter.css Restyle edit box dimensions 2019-08-17 18:53:13 +02:00
ext.abuseFilter.edit.js Restyle edit box dimensions 2019-08-17 18:53:13 +02:00
ext.abuseFilter.examine.js Restyle edit box dimensions 2019-08-17 18:53:13 +02:00
ext.abuseFilter.tools.js Restyle edit box dimensions 2019-08-17 18:53:13 +02:00
mode-abusefilter.js build: Update npm dependencies 2019-07-31 17:29:00 +00:00
red_x.png Compress PNGs with zopflipng 2016-02-20 20:17:20 +00:00
yes_check.png Compress PNGs with zopflipng 2016-02-21 00:51:11 +00:00