Page MenuHomePhabricator

API should report why the merge failed, just like Special:MergeItems does
Closed, ResolvedPublic5 Story Points

Description

Currently, the API only reports Attempted modification of the item failed.

However, on Special:MergeItems you will see more detailed report like The two items cannot be merged because one of them links to the other using property P460.

This should help users figure out why they cannot merge two items using the gadget.

Event Timeline

Restricted Application added a subscriber: Aklapper. · View Herald TranscriptNov 12 2017, 9:41 AM

Any progress? Every week multiple times arrive complaints about unsuccessful merges at MediaWiki talk:Gadget-Merge.js; in most of the cases the user would understand the problem if the software said them.

Lydia_Pintscher triaged this task as Normal priority.Apr 13 2018, 12:32 PM
Lydia_Pintscher moved this task from incoming to ready to go on the Wikidata board.
WMDE-leszek set the point value for this task to 5.
WMDE-leszek moved this task from Tasks to User Stories on the Wikidata-Ministry-Of-Magic board.

Change 428830 had a related patch set uploaded (by Ladsgroup; owner: Amir Sarabadani):
[mediawiki/extensions/Wikibase@master] Make merge items api error reporting similar to its special page counterpart

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

Ladsgroup added a subscriber: Ladsgroup.

With this patch, it now looks like this:

{
    "error": {
        "code": "failed-modify",
        "info": "Attempted modification of the item failed.",
        "extradata": [
            "Conflicting descriptions for language en"
        ],
        "messages": [
            {
                "name": "wikibase-api-failed-modify",
                "parameters": [],
                "html": {
                    "*": "Attempted modification of the item failed."
                }
            }
        ],
        "*": "See http://localhost/mediawiki2/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."
    }
}
Restricted Application added a project: User-Ladsgroup. · View Herald TranscriptApr 27 2018, 10:32 PM

Change 428830 merged by jenkins-bot:
[mediawiki/extensions/Wikibase@master] Make merge items api error reporting similar to its special page counterpart

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

@matej_suchanek Does this work for you now? Anything that still needs to happen or are we good to close this?

As soon as the change arrives to Wikidata, it also needs to implemented in the gadget. But that's a separate issue.

Lydia_Pintscher closed this task as Resolved.May 14 2018, 9:29 AM

Ok great :) Closing then. If there is anything that's not working as you want it please reopen.