Page MenuHomePhabricator

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

Description

image.png (87×1 px, 30 KB)

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 subscriber: Aklapper. · View Herald Transcript

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)

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

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! :)