Page MenuHomePhabricator

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


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

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 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

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 <> for notice of API deprecations and breaking changes."

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

@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.

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