Page MenuHomePhabricator

[Bug] new representation same language code overwrites existing representation
Closed, ResolvedPublic5 Estimated Story Points

Description

Problematic behavior: When I add a new representation to a Form or a new Lemma to a Lexeme that already has one and I use the same language code then the edit is accepted and the existing representation/Lemma is replaced.

What I do

Screenshot from 2018-05-23 14-52-30.png (210×978 px, 22 KB)

What I get after saving

Screenshot from 2018-05-23 14-52-38.png (174×948 px, 16 KB)

What I get after reloading the page

Screenshot from 2018-05-23 14-52-43.png (183×971 px, 14 KB)

Expected behavior:
GIVEN I am on the Form part of a Lexeme page
AND There as a representation with the language code "de"
WHEN I add an additional representation with the language code "de"
THEN an error is shown saying "It is not possible to enter two representations with the same language code."

Note: API should deal with possible "incorrect" JSON input in a similar way it handles similar input e.g. when editing item labels, i.e. take the last representation.

Related Objects

Mentioned In
T195372: Prevent entering of lemmas with the same spelling variant
rEWLE9e7c90984821: Representation language: Add aria-invalid
rEWLEb4d0766d9fd7: Representation language: Add aria-invalid
rEWLEee5326e3cc7d: WIP Lemmas: Prevent redundant langugages
rEWLEb3ad4df57fa6: WIP Lemmas: Prevent redundant langugages
rEWLE91cdee79f302: Representation language: Add aria-invalid
rEWLE35cf0c2229a4: Representation language: Pre-existing bind syntax
rEWLE8bf77a6a036d: WIP Lemmas: Prevent redundant langugages
rEWLE03e67fa7d4d5: WIP Lemmas: Prevent redundant langugages
rEWLEd51ecbbbf0bb: WIP Lemmas: Prevent redundant langugages
rEWLEbc922534e2ea: Form representations: Prevent redundant langugages
rEWLEb29246830e42: Form representations: Prevent redundant langugages
rEWLE5b9032f7148a: WIP Lemmas: Prevent redundant langugages
rEWLEbf8a2ab37c3a: Form representations: Prevent redundant langugages
rEWLEa09a4e199add: Form representations: Prevent redundant langugages
rEWLE98f2ca389695: WIP Representation language: Prevent redundant lang
rEWLEf9aab34fbc64: WIP Representation language: Prevent redundant lang
rEWLE7cc05e5641a9: WIP Representation language: Prevent redundant lang
rEWLEe3ab228e0b23: WIP Representation language: Prevent redundant lang
rEWLEe9cdaf24b753: WIP Representation language: Prevent redundant lang
rEWLEca23047f3cac: WIP Representation language: Prevent redundant lang
Mentioned Here
T196342: Header save button disabled when nothing to save
T195372: Prevent entering of lemmas with the same spelling variant

Event Timeline

Restricted Application added a subscriber: Aklapper. · View Herald Transcript
WMDE-leszek set the point value for this task to 5.

Change 435189 had a related patch set uploaded (by Pablo Grass (WMDE); owner: Pablo Grass (WMDE)):
[mediawiki/extensions/WikibaseLexeme@master] WIP Representation language: Prevent redundant lang

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

Discussed with @Lydia_Pintscher about challenges in validating on save-time, spiked a more snappy approach showing feedback while entering data...

Bildschirmfoto vom 2018-05-25 18-31-28.png (1×1 px, 144 KB)

This might actually be more helpful to the user but keeps unsolved how to react should the user still resorts to clicking the save button.

@Lydia_Pintscher T195372 (the same problem for lemmas) was merged into this ticket. So is solving both problems now expected from this ticket here? Mind mending the title and maybe even adding a second BDD block?

Lydia_Pintscher renamed this task from [Bug] new representation with same language code overwrites existing representation to [Bug] new representation or Lemma with same language code overwrites existing representation.May 30 2018, 10:21 AM
Lydia_Pintscher updated the task description. (Show Details)

I updated the description as discussed.

@Lydia_Pintscher

Lexeme lemmas and form representations use two rather different UX paradigms. This was the case already before this ticket was started but as we are now also dealing with validation and error messages we have to use one approach or the other.

  • Lemmas offers you the save button to click while the form is invalid (e.g. a lemma w/o a term value) - validation is done on the server-side and only presented after receiving the answer (tooltip on the save button).
  • Form representations disables (or at least tries to) the save button while the form is invalid - validation is done (partially) on the client and shown before the mistake is submitted.

The latter works well with the new approach of highlighting the invalid form field and indicating the problem already while the user is editing.
Applying the approach taken for representations to the lemmas would cause an inconsistency in how lemma (or header) errors are communicated to the user.

How do we proceed? There will be an inconsistency but we can transition away from it, the question is in which direction. In case of redundant lemma languages...

  • keep the lemma widget's submit button enabled and show the error only when the user clicks? (accept the inconsistency between lemma and representation widget)
  • disable the lemma widget's submit button? (accept the inconsistency inside lemma widget)

Remarks:

  • Technically the first option would be easier
  • Even when transitioning towards the "show errors immediately" generally we'd still need to maintain the capability to display post-submit errors because the frontend can only facilitate plausibility checks, backend errors can always still happen

Change 436800 had a related patch set (by Pablo Grass (WMDE)) published:
[mediawiki/extensions/WikibaseLexeme@master] Representation language: Pre-existing bind syntax

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

Change 436806 had a related patch set (by Pablo Grass (WMDE)) published:
[mediawiki/extensions/WikibaseLexeme@master] Representation language: Add aria-invalid

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

Change 435189 merged by jenkins-bot:
[mediawiki/extensions/WikibaseLexeme@master] Form representations: Prevent redundant langugages

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

Change 436800 merged by jenkins-bot:
[mediawiki/extensions/WikibaseLexeme@master] Representation language: Pre-existing bind syntax

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

Pablo and I just discussed this and to be consistent with all the other places we could find (Form representation, statements, term box) we should disable the Lemma widget's submit button when there is invalid input.

Change 436806 merged by jenkins-bot:
[mediawiki/extensions/WikibaseLexeme@master] Representation language: Add aria-invalid

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

Pablo-WMDE renamed this task from [Bug] new representation or Lemma with same language code overwrites existing representation to [Bug] new representation same language code overwrites existing representation.Jun 5 2018, 11:26 AM
Pablo-WMDE moved this task from Doing to Peer Review on the Wikidata-Turtles-Sprint #5 board.
Pablo-WMDE updated the task description. (Show Details)

The respective lemma ticket T195372 was reopened as dedicated challenge as it depends on some scaffolding yet to be created (T196342)

Vvjjkkii renamed this task from [Bug] new representation same language code overwrites existing representation to jsdaaaaaaa.Jul 1 2018, 1:12 AM
Vvjjkkii reopened this task as Open.
Vvjjkkii removed Lydia_Pintscher as the assignee of this task.
Vvjjkkii updated the task description. (Show Details)
Vvjjkkii removed the point value for this task.
Vvjjkkii removed subscribers: gerritbot, Aklapper.
CommunityTechBot renamed this task from jsdaaaaaaa to [Bug] new representation same language code overwrites existing representation.Jul 1 2018, 9:48 PM
CommunityTechBot closed this task as Resolved.
CommunityTechBot assigned this task to Lydia_Pintscher.
CommunityTechBot set the point value for this task to 5.
CommunityTechBot updated the task description. (Show Details)
CommunityTechBot added subscribers: gerritbot, Aklapper.