Page MenuHomePhabricator

`content was: ""` (empty string) when deleting Lexemes
Closed, ResolvedPublic8 Estimated Story Points

Description

Problem: When deleting a Lexeme, it is indicated that the content was an empty string (""). This prevents users from identifying what the Lexeme was about before it was deleted.

Example:

BDD
GIVEN a Lexeme
AND it was deleted
WHEN viewing the page of the Lexeme
THEN The message indicating deletion contains the Lemmas of the deleted Lexeme

Acceptance criteria:

  • Page of a deleted Lexeme contains content was: "<list of lemmas>" […] message
  • If there are several Lemmas we separate them by ","

Notes:

  • This is related to the edit summary of the deletion edit.
  • EntityContent::getTextForSummary is doing this for the other entity types.
  • Currently the code assumes that all entities have Labels, which is not true for Lexemes - consider changing this.

Possible way forward:

  • Inside of EntityContent make getTextForSummary abstract and force all implementations to have their own.
  • Inside Item / Property-Content find a way to share this logic between the two.

Event Timeline

toan updated the task description. (Show Details)
toan changed the point value for this task from 13 to 8.Oct 13 2020, 2:12 PM

@darthmon_wmde @Lydia_Pintscher Having looked at this together in the task inspection we re-estimated this to a more modest 8.

As this comment correctly says, not all entities have a concept of what Labels are - it just so happens that all entities types in core wikibase (items, properties) have them.

There are already dedicated EntityContent implementations for items & properties (ItemContent & PropertyContent respectively - they should use a way of de-duplicating the relevant code (e.g. traits) without making false assumptions.

Lexeme's LexemeContent should gain a correct implementation.

MediaInfo's MediaInfoContent has to implement the method the way it is correct for it (currently it returns empty string there, which is probably a good enough value as far as camp is concerned).

Change 634006 had a related patch set uploaded (by Tobias Andersson; owner: Tobias Andersson):
[mediawiki/extensions/Wikibase@master] Add trait for getTextSummary

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

Change 634007 had a related patch set uploaded (by Tobias Andersson; owner: Tobias Andersson):
[mediawiki/extensions/WikibaseLexeme@master] Add getTextSummary for LexemeContent

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

Change 634025 had a related patch set uploaded (by Tobias Andersson; owner: Tobias Andersson):
[mediawiki/extensions/Wikibase@master] Make EntityContent::getTextForSummary abstract

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

Change 634009 had a related patch set uploaded (by Tobias Andersson; owner: Tobias Andersson):
[mediawiki/extensions/WikibaseMediaInfo@master] Use getTextSummaryTrait

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

Change 634009 abandoned by Tobias Andersson:
[mediawiki/extensions/WikibaseMediaInfo@master] Add getTextSummary method for MediaInfoContent

Reason:
After discussing this with Lucas we decided to go with https://gerrit.wikimedia.org/r/c/634007 and skip the trait since MediaInfo is in fact a LabelsProvider and the only exception is LexemeContent.

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

Change 634025 abandoned by Tobias Andersson:
[mediawiki/extensions/Wikibase@master] Make EntityContent::getTextForSummary abstract

Reason:
After discussing this with Lucas we decided we want to skip the idea of the trait since most EntityContent entities are LabelsProviders.

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

Change 634006 abandoned by Tobias Andersson:
[mediawiki/extensions/Wikibase@master] Add trait for getTextSummary

Reason:
After a lot of discussions we decided against the idea of using a trait for this.

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

Change 634494 had a related patch set uploaded (by Tobias Andersson; owner: Tobias Andersson):
[mediawiki/extensions/Wikibase@master] Make getTextForSummary less forgiving.

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

Change 634007 merged by jenkins-bot:
[mediawiki/extensions/WikibaseLexeme@master] Add getTextSummary for LexemeContent

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

Change 634494 merged by jenkins-bot:
[mediawiki/extensions/Wikibase@master] Make getTextForSummary less forgiving.

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