Page MenuHomePhabricator

Wikidata sitelink save, shows error message twice.
Open, MediumPublic

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:

Event Timeline

HakanIST created this task.Thu, Aug 20, 6:48 AM
Restricted Application added a subscriber: Aklapper. · View Herald TranscriptThu, Aug 20, 6:48 AM
Lydia_Pintscher renamed this task from Wikidata item save, shows error message twice. to Wikidata sitelink save, shows error message twice..Thu, Aug 20, 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 Prioritized Product on the Wikidata-Campsite board.
Addshore updated the task description. (Show Details)Tue, Aug 25, 12:12 PM

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


uselang=en:

Jakob_WMDE added a comment.EditedFri, Sep 4, 3:34 PM

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.

Jakob_WMDE removed Jakob_WMDE as the assignee of this task.Mon, Sep 7, 9:36 AM
Jakob_WMDE added a subscriber: Jakob_WMDE.

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:

With the Jakob's patch it becomes this:

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