[Wikidata-bugs] [Maniphest] [Edited] T183939: The wbeditentity API seems to overwrite labels/descriptions even with the "add" parameter (that should preserve them)

2018-01-02 Thread valerio.bozzolan
valerio.bozzolan updated the task description. (Show Details)
CHANGES TO TASK DESCRIPTION...* https://www.wikidata.org/w/index.php?title=Q3314490=cur614852618=614852618599844571

You can note that labels were overwrited. But this was the data (note the `add` parameters) related of that save:...TASK DETAILhttps://phabricator.wikimedia.org/T183939EMAIL PREFERENCEShttps://phabricator.wikimedia.org/settings/panel/emailpreferences/To: valerio.bozzolanCc: 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


[Wikidata-bugs] [Maniphest] [Edited] T183939: The wbeditentity API seems to overwrite labels/descriptions even with the "add" parameter (that should preserve them)

2018-01-02 Thread valerio.bozzolan
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=cur=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 expectedApparently 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=cur=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": 

[Wikidata-bugs] [Maniphest] [Edited] T183939: The wbeditentity API seems to overwrite labels/descriptions even with the "add" parameter (that should preserve them)

2018-01-02 Thread valerio.bozzolan
valerio.bozzolan updated the task description. (Show Details)
CHANGES TO TASK DESCRIPTION...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.TASK DETAILhttps://phabricator.wikimedia.org/T183939EMAIL PREFERENCEShttps://phabricator.wikimedia.org/settings/panel/emailpreferences/To: valerio.bozzolanCc: 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


[Wikidata-bugs] [Maniphest] [Edited] T183939: The wbeditentity API seems to overwrite labels/descriptions even with the "add" parameter (that should preserve them)

2018-01-02 Thread valerio.bozzolan
valerio.bozzolan updated the task description. (Show Details)
CHANGES TO TASK DESCRIPTION...As workaround I can don't rely on the `add` parameter and do some client-side decisions, when creating claims, comparingI have to don't rely on the existing`add` parameter on labels/descripttions 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 labels/descriptions accreation of claims and the addition versus the claims acof labels/descriptions.TASK DETAILhttps://phabricator.wikimedia.org/T183939EMAIL PREFERENCEShttps://phabricator.wikimedia.org/settings/panel/emailpreferences/To: valerio.bozzolanCc: 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