Page MenuHomePhabricator

Clearing a Lexeme via wbeditentity will reset the FormId counter for the entity.
Closed, ResolvedPublic3 Story Points

Description

This comes down to EditEntity::clearEntity which will make an api request to wbeditentity for a lexeme with the clear parameter forget about the formid counter.

Event Timeline

Restricted Application added a project: Wikidata. · View Herald TranscriptApr 16 2018, 11:04 AM
Restricted Application added a subscriber: Aklapper. · View Herald Transcript
Addshore added a comment.EditedApr 16 2018, 11:12 AM

It might make sense for EntityDocument to have a clear() method in the interface. This could also be in some other service and not attached to the document itself.

Then in EditEntity::clearEntity instead of creating a new Entity you could create a copy() and call clear() which would have special handling for Lexeme (and also special handling for Property, which is currently hard coded in EditEntity)

WMDE-leszek set the point value for this task to 3.Apr 17 2018, 3:24 PM
Jakob_WMDE moved this task from To Do to Doing on the Wikidata-Turtles-Sprint#4 board.

Change 429792 had a related patch set uploaded (by Jakob; owner: Jakob):
[mediawiki/extensions/Wikibase@master] [DNM] Let entities clear themselves

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

PR merged, and 7.4.0 of DataModel released.

Change 430327 had a related patch set uploaded (by Addshore; owner: Addshore):
[mediawiki/vendor@master] Update wikibase/data-model to 7.4.0

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

Change 430372 had a related patch set uploaded (by Jakob; owner: Jakob):
[mediawiki/extensions/WikibaseLexeme@master] Implement ClearableEntity for Form and Lexeme

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

Change 430386 had a related patch set uploaded (by Jakob; owner: Jakob):
[mediawiki/extensions/WikibaseLexeme@master] Test that using clear with wbeditentity does not reset nextFormId for lexemes

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

Change 430327 merged by jenkins-bot:
[mediawiki/vendor@master] Update wikibase/data-model to 7.5.0

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

Change 430372 merged by jenkins-bot:
[mediawiki/extensions/WikibaseLexeme@master] Implement ClearableEntity for Form and Lexeme

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

Change 429792 merged by jenkins-bot:
[mediawiki/extensions/Wikibase@master] Let entities clear themselves

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

Change 430386 merged by jenkins-bot:
[mediawiki/extensions/WikibaseLexeme@master] Test that using clear with wbeditentity does not reset nextFormId for lexemes

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

Can we have an example link/edit? Thanks! :)