mediawiki-extensions-AbuseF.../includes
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
..
api Add a new API module to retrieve private details from AbuseLog 2019-08-09 21:10:28 +00:00
pagers Tweak methods related to global filters 2019-07-02 17:02:50 +02:00
parser Merge "Add a new class for the CachingParser's AST" 2019-08-25 18:00:24 +00:00
special Add a new API module to retrieve private details from AbuseLog 2019-08-09 21:10:28 +00:00
Views Don't show empty "Tools:" section in ViewEdit 2019-08-21 17:32:43 +02:00
AbuseFilter.php Don't hardcode blockautopromote duration 2019-08-24 11:40:11 +02:00
AbuseFilterChangesList.php Merge "Don't send long patterns with GET" 2019-01-20 14:20:31 +00:00
AbuseFilterHooks.php Actually return errors for action=edit API 2019-09-09 20:15:19 +02:00
AbuseFilterModifyLogFormatter.php build: Upgrade phan-taint-check-plugin from 1.5.x to 2.0.1 2019-07-10 15:30:52 +00:00
AbuseFilterPreAuthenticationProvider.php Add a new class for methods related to running filters 2019-07-23 19:06:27 +00:00
AbuseFilterRightsLogFormatter.php Don't hardcode blockautopromote duration 2019-08-24 11:40:11 +02:00
AbuseFilterRunner.php Merge "Add a hook to determine whether the current action should be filtered" 2019-08-25 18:45:07 +00:00
AbuseFilterSuppressLogFormatter.php Migrate AbuseFilter suppress log 2018-08-21 16:05:54 +00:00
AbuseFilterVariableHolder.php Specialize empty AFPData types 2019-08-04 15:26:57 +00:00
AbuseLogHitFormatter.php Minor escaping fixes 2018-07-05 18:51:30 +00:00
AFComputedVariable.php Profiling: don't count time for operations shared with the edit 2019-08-04 20:12:10 +00:00
TableDiffFormatterFullContext.php Fix coding conventions exclusion rules 2018-04-20 08:40:18 +00:00