Page MenuHomePhabricator

API action=edit with errorformat=html returns a redundant 'hookaborted' error even when an error message is set
Closed, ResolvedPublic

Description

For some edits, API action=edit with errorformat=html returns a redundant 'hookaborted' error even when an error message is set.

For example, trying to edit an UploadWizard 'Campaign' page with invalid JSON:

https://commons.wikimedia.beta.wmflabs.org/wiki/Special:ApiSandbox#action=edit&format=json&errorformat=html&title=Campaign%3Atest&text=%7B

{
    "errors": [
        {
            "code": "eventlogging-invalid-json",
            "module": "edit",
            "*": "Invalid JSON"
        },
        {
            "code": "hookaborted",
            "module": "edit",
            "*": "The modification you tried to make was aborted by an extension."
        }
    ],
    "servedby": "deployment-mediawiki-09",
    "*": "See https://commons.wikimedia.beta.wmflabs.org/w/api.php for API usage. Subscribe to the mediawiki-api-announce mailing list at <https://lists.wikimedia.org/mailman/listinfo/mediawiki-api-announce> for notice of API deprecations and breaking changes."
}

I also noticed this in my work on AbuseFilter and SpamBlacklist in T229539.

Details

Event Timeline

matmarex created this task.Aug 26 2019, 9:24 PM
Restricted Application added a project: Core Platform Team. · View Herald TranscriptAug 26 2019, 9:24 PM
Restricted Application added a subscriber: Aklapper. · View Herald Transcript

Change 532465 had a related patch set uploaded (by Bartosz Dziewoński; owner: Bartosz Dziewoński):
[mediawiki/core@master] EditPage: Don't set 'hookaborted' error if the hook set a better error

https://gerrit.wikimedia.org/r/532465

matmarex updated the task description. (Show Details)Aug 27 2019, 4:15 PM
WDoranWMF triaged this task as Medium priority.Aug 28 2019, 3:08 AM

Change 532465 merged by jenkins-bot:
[mediawiki/core@master] EditPage: Don't set 'hookaborted' error if the hook set a better error

https://gerrit.wikimedia.org/r/532465

Anomie closed this task as Resolved.Sep 4 2019, 3:37 PM