Page MenuHomePhabricator

Wikidata sitelink save, shows error message twice.
Closed, ResolvedPublic

Assigned To
Authored By
HakanIST
Aug 20 2020, 6:48 AM
Referenced Files
F32350877: image.png
Sep 14 2020, 8:05 PM
F32350883: image.png
Sep 14 2020, 8:05 PM
F32245214: Screenshot from 2020-09-04 17-17-00.png
Sep 4 2020, 3:34 PM
F32194450: Screenshot_2020-08-25 VqVycLSs.png
Aug 25 2020, 12:15 PM
F32194446: Screenshot_2020-08-25 VqVycLSs.png
Aug 25 2020, 12:14 PM
F32189796: image.png
Aug 20 2020, 10:34 AM
F32189621: save-turkish.jpg
Aug 20 2020, 6:48 AM
F32189623: save-english.png
Aug 20 2020, 6:48 AM

Description

Problem:
When saving a sitelink in an item. Wikidata UI is reporting 2 error messages with essentially the same content but different wording. One of them is translated and one of them is not when setting the interface language to something other than English.
There should only be one message. It should be translatable.

Steps to reproduce (production)

(Can also be reproduced on test.wikidata.org)

To reproduce locally

  • Just needs Wikibase extension with a client setup and an item with a sitelink already existing.

Screenshots/mockups:

save-turkish.jpg (589×1 px, 91 KB)

save-english.png (1×1 px, 149 KB)

image.png (298×401 px, 30 KB)

Event Timeline

Lydia_Pintscher renamed this task from Wikidata item save, shows error message twice. to Wikidata sitelink save, shows error message twice..Aug 20 2020, 10:34 AM
Lydia_Pintscher triaged this task as Medium priority.
Lydia_Pintscher updated the task description. (Show Details)
Lydia_Pintscher moved this task from Incoming to Unconnected Stories on the Wikidata-Campsite board.

On Test Wikidata (add testwikidatawiki:Wikidata:Main Page to Q148747):
uselang=qqx:

Screenshot_2020-08-25 VqVycLSs.png (263×387 px, 25 KB)

uselang=en:
Screenshot_2020-08-25 VqVycLSs.png (317×390 px, 33 KB)

I can reproduce this locally and found similarly broken cases while trying to figure out what the response is actually supposed to look like. It seems that ApiErrorReporter::dieStatus is expected to always add an English error message on top of the localized (in the user language) error. I'm not sure yet whether the problem lies in ApiErrorReporter, in the code that consumes its output, or somewhere else.

I wonder if this is related to changes regarding the API errorformat, e.g. T242769?

Example of a similar case: with uselang=de edit conflicts show one error in German and one in English. Interestingly it looks fine when the language is English, i.e. it's not shown twice as it's the case described in the task description here.

Screenshot from 2020-09-04 17-17-00.png (140×263 px, 15 KB)

Change 625897 had a related patch set uploaded (by Jakob; owner: Jakob):
[mediawiki/extensions/Wikibase@master] EntitySavingHelper: allow ArrayAccess object status values

https://gerrit.wikimedia.org/r/625897

I can locally reproduce it too:

image.png (271×372 px, 33 KB)

With the Jakob's patch it becomes this:

image.png (200×374 px, 24 KB)

Maybe we can use the localized version of "The save has failed" but that can be done in another patch I assume?

Change 625897 merged by jenkins-bot:
[mediawiki/extensions/Wikibase@master] EntitySavingHelper: allow ArrayAccess object status values

https://gerrit.wikimedia.org/r/625897

Change 627428 had a related patch set uploaded (by Jakob; owner: Jakob):
[mediawiki/extensions/Wikibase@master] EntitySavingHelper: make array key check safe

https://gerrit.wikimedia.org/r/627428

[...]
Maybe we can use the localized version of "The save has failed" but that can be done in another patch I assume?

The part that I find confusing is that the code and respective tests are quite explicit about adding the error message in English. What's shown in the UI is obviously not what we want, but I'm not sure what the API error response is even supposed to look like if it needs changing.

Change 627428 merged by jenkins-bot:
[mediawiki/extensions/Wikibase@master] EntitySavingHelper: make array key check safe

https://gerrit.wikimedia.org/r/627428