Last modified: 2013-03-13 16:20:57 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T48023, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 46023 - Call wbsetclaim creates a new claim instead of editing an existing one
Call wbsetclaim creates a new claim instead of editing an existing one
Status: VERIFIED FIXED
Product: MediaWiki extensions
Classification: Unclassified
WikidataRepo (Other open bugs)
unspecified
All All
: Unprioritized blocker (vote)
: ---
Assigned To: Jeroen De Dauw
:
Depends on:
Blocks: 44683
  Show dependency treegraph
 
Reported: 2013-03-12 11:17 UTC by Henning
Modified: 2013-03-13 16:20 UTC (History)
4 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments

Description Henning 2013-03-12 11:17:51 UTC
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.
Comment 1 Henning 2013-03-12 16:00:33 UTC
https://gerrit.wikimedia.org/r/#/c/53367/
Comment 2 abraham.taherivand 2013-03-13 16:20:57 UTC
Verified in Wikidata demo sprint 35

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links