https://bugzilla.wikimedia.org/show_bug.cgi?id=46023

       Web browser: ---
            Bug ID: 46023
           Summary: Call wbsetclaim creates a new claim instead of editing
                    an existing one
           Product: MediaWiki extensions
           Version: unspecified
          Hardware: All
                OS: All
            Status: NEW
          Severity: blocker
          Priority: Unprioritized
         Component: WikidataRepo
          Assignee: [email protected]
          Reporter: [email protected]
                CC: [email protected],
                    [email protected]
    Classification: Unclassified
   Mobile Platform: ---

Editing an existing claim via the API wbsetclaim module will result in creating
a new claim. An API call looks like:
/mediawiki/core/api.php?action=wbsetclaim&format=json&claim=%7B%22type%22%3A%22claim%22%2C%22mainsnak%22%3A%7B%22snaktype%22%3A%22value%22%2C%22property%22%3A%22p1110%22%2C%22datavalue%22%3A%7B%22type%22%3A%22wikibase-entityid%22%2C%22value%22%3A%7B%22entity-type%22%3A%22item%22%2C%22numeric-id%22%3A2647%7D%7D%7D%2C%22id%22%3A%22q2647%24574052AD-1518-4CD3-A21C-637837C7C040%22%2C%22qualifiers%22%3A%7B%7D%7D&token=%2B%5C&baserevid=17420

The API result seems to be correct:
{
    "pageinfo": {
        "lastrevid": 17426
    },
    "claim": {
        "id": "q2647$574052AD-1518-4CD3-A21C-637837C7C040",
        "mainsnak": {
            "snaktype": "value",
            "property": "p1110",
            "datavalue": {
                "value": {
                    "entity-type": "item",
                    "numeric-id": 2647
                },
                "type": "wikibase-entityid"
            }
        },
        "type": "claim"
    }
}

However, featuring one claim in the beginning, the entity will have two claims
now which can be verified in the UI.
The operation seems to mess up the revisions since removing a claim via the UI
seems to trigger the "remove" action on a wrong revision.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
You are watching all bug changes.
_______________________________________________
Wikibugs-l mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/wikibugs-l

Reply via email to