Page MenuHomePhabricator

[Bug] Adding a second Gloss in the same language overwrites existing Gloss
Closed, ResolvedPublic

Description

Problem:
It is possible to add a second Gloss in the same language to a Sense. The edit then overwrites the existing Gloss. It should not be possible to add a second Gloss for the same language.

Screenshot:
How this looks for the spelling variant check on Lemma and Representation:


BDD
GIVEN a Sense has a Gloss in language A
AND I try to add another Gloss in language A
THEN the language field is marked in red
AND a a message appears saying "It is not possible to enter multiple Glosses with the same language."
AND the "publish" link is grayed out

Acceptance criteria:

  • I can not store a second Gloss for the same language on the same Sense

Notes:

  • Also check this for the API.
  • The desired behavior is already in place for spelling variant of Lemma and Representation.

Details

Related Gerrit Patches:
mediawiki/extensions/WikibaseLexeme : masterSenses: Prevent redundant gloss languages
mediawiki/extensions/WikibaseLexeme : masterWIP: Warn about sense glosses with duplicate language codes
mediawiki/extensions/WikibaseLexeme : masterCheck for duplicate gloss language codes
mediawiki/extensions/WikibaseLexeme : master[WIP] Throw error when two glosses in a sense have the same language

Event Timeline

Restricted Application added a project: Wikidata. · View Herald TranscriptAug 21 2018, 4:33 PM
Ladsgroup set the point value for this task to 3.

This is a little bit more complex than it looks because the frontend sends exactly the same request when someone adds a gloss with duplicated language (invalid) or just changes the gloss (valid). So handling it in backend seems tricky or not even needed. We need to do the check in frontend anyway.

Change 455863 had a related patch set uploaded (by Ladsgroup; owner: Amir Sarabadani):
[mediawiki/extensions/WikibaseLexeme@master] [WIP] Throw error when two glosses in a sense have the same language

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

This sounds a lot like T195372 - are we making sure that the resulting user experience is comparable?

Addshore moved this task from incoming to in progress on the Wikidata board.Aug 30 2018, 9:13 AM
Lydia_Pintscher removed the point value for this task.Sep 2 2018, 12:45 PM

Excellent point. Will adapt the task description. Also removing story points as it will probably need to be reestimated.

Change 457919 had a related patch set uploaded (by Lucas Werkmeister (WMDE); owner: Lucas Werkmeister (WMDE)):
[mediawiki/extensions/WikibaseLexeme@master] Check for duplicate gloss language codes

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

Change 455863 abandoned by Ladsgroup:
[WIP] Throw error when two glosses in a sense have the same language

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

Change 457919 abandoned by Lucas Werkmeister (WMDE):
Check for duplicate gloss language codes

Reason:
This clearly goes against whatever we’re currently doing for similar cases elsewhere, whether I like it or not.

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

@Lydia_Pintscher & WMDE-Design how does this look?

The Forms version looks like this:

I could also switch the order of the add button and the error:

Change 459564 had a related patch set uploaded (by Addshore; owner: Addshore):
[mediawiki/extensions/WikibaseLexeme@master] WIP Senses: Prevent redundant gloss languages

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

Addshore claimed this task.Sep 10 2018, 3:42 PM
Restricted Application added a project: User-Addshore. · View Herald TranscriptSep 10 2018, 3:42 PM

Change 459569 had a related patch set uploaded (by Lucas Werkmeister (WMDE); owner: Lucas Werkmeister (WMDE)):
[mediawiki/extensions/WikibaseLexeme@master] WIP: Warn about sense glosses with duplicate language codes

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

Change 459564 merged by jenkins-bot:
[mediawiki/extensions/WikibaseLexeme@master] Senses: Prevent redundant gloss languages

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

Change 459569 abandoned by Lucas Werkmeister (WMDE):
WIP: Warn about sense glosses with duplicate language codes

Reason:
Superseded by Ifa48f76dff.

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