valerio.bozzolan updated the task description. (Show Details)

CHANGES TO TASK DESCRIPTION
...
== Bug ==
When doing both the actions in the same request (creating claims and adding unexisting labels/descriptions), it seems to ignore the `add` parameter, and labels/descriptions are overwrited.

As an example, look at this diff:

* https://www.wikidata.org/w/index.php?title=Q3314490&diff=cur&oldid=614852618

You can note that labels/descriptions were overwrited. But this was the data (note the `add` parameters):

This data reproduces the problem:

```
{
"labels": [
{
"language": "en",
"value": "Milos Culafic",
"add": "1"
},
{
"language": "it",
"value": "Milos Culafic",
"add": "1"
}
],
"descriptions": [
{
"language": "en",
"value": "Montenegrin volleyball player",
"add": "1"
},
{
"language": "it",
"value": "pallavolista montenegrino",
"add": "1"
}
],
"claims": {
"P18": [
{
"type": "statement",
"rank": "normal",
"references": [
{
"snaks": {
"P248": [
{
"snaktype": "value",
"property": "P248",
"datatype": "wikibase-item",
"datavalue": {
"type": "wikibase-entityid",
"value": {
"entity-type": "item",
"numeric-id": 16571730,
"id": "Q16571730"
}
}
}
]
}
}
],
"mainsnak": {
"snaktype": "value",
"property": "P18",
"datatype": "commonsMedia",
"datavalue": {
"type": "string",
"value": "Milos Culafic (Legavolley 2017).jpg"
}
}
}
],
"P373": [
{
"type": "statement",
"rank": "normal",
"references": [
{
"snaks": {
"P248": [
{
"snaktype": "value",
"property": "P248",
"datatype": "wikibase-item",
"datavalue": {
"type": "wikibase-entityid",
"value": {
"entity-type": "item",
"numeric-id": 16571730,
"id": "Q16571730"
}
}
}
]
}
}
],
"mainsnak": {
"snaktype": "value",
"property": "P373",
"datatype": "string",
"datavalue": {
"type": "string",
"value": "Milos Culafic"
}
}
}
]
}
}
```

As workaround, when creating claims, I have to don't rely on the `add` parameter on labels/descriptions and do some client-side decisions for them, like comparing the existing labels/descriptions values and skipping the existings. I can also split in multiple requests the creation of claims and the addition of labels/descriptions in order to use the `add` flag as expected
Apparently only when doing both the actions in the same request (creating claims and adding unexisting labels/descriptions), it seems to ignore the `add` parameter, and labels/descriptions are overwrited.

As an example, look at this diff:

* https://www.wikidata.org/w/index.php?title=Q3314490&diff=cur&oldid=614852618

You can note that labels were overwrited. But this was the data (note the `add` parameters) related of that save:

```
{
"labels": [
{
"language": "en",
"value": "Milos Culafic",
"add": "1"
},
{
"language": "it",
"value": "Milos Culafic",
"add": "1"
}
],
"descriptions": [
{
"language": "en",
"value": "Montenegrin volleyball player",
"add": "1"
},
{
"language": "it",
"value": "pallavolista montenegrino",
"add": "1"
}
],
"claims": {
"P18": [
{
"type": "statement",
"rank": "normal",
"references": [
{
"snaks": {
"P248": [
{
"snaktype": "value",
"property": "P248",
"datatype": "wikibase-item",
"datavalue": {
"type": "wikibase-entityid",
"value": {
"entity-type": "item",
"numeric-id": 16571730,
"id": "Q16571730"
}
}
}
]
}
}
],
"mainsnak": {
"snaktype": "value",
"property": "P18",
"datatype": "commonsMedia",
"datavalue": {
"type": "string",
"value": "Milos Culafic (Legavolley 2017).jpg"
}
}
}
],
"P373": [
{
"type": "statement",
"rank": "normal",
"references": [
{
"snaks": {
"P248": [
{
"snaktype": "value",
"property": "P248",
"datatype": "wikibase-item",
"datavalue": {
"type": "wikibase-entityid",
"value": {
"entity-type": "item",
"numeric-id": 16571730,
"id": "Q16571730"
}
}
}
]
}
}
],
"mainsnak": {
"snaktype": "value",
"property": "P373",
"datatype": "string",
"datavalue": {
"type": "string",
"value": "Milos Culafic"
}
}
}
]
}
}
```

As workaround, I have to don't rely on the `add` parameter on labels/descriptions and do some client-side decisions for them, like comparing the existing labels/descriptions values and skipping the existings
.

TASK DETAIL
https://phabricator.wikimedia.org/T183939

EMAIL PREFERENCES
https://phabricator.wikimedia.org/settings/panel/emailpreferences/

To: valerio.bozzolan
Cc: valerio.bozzolan, Aklapper, Lahi, Gq86, GoranSMilovanovic, QZanden, LawExplorer, Wikidata-bugs, aude, Mbch331
_______________________________________________
Wikidata-bugs mailing list
Wikidata-bugs@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/wikidata-bugs

Reply via email to