Page MenuHomePhabricator

Add & Edit Forms via wbeditentity
Closed, ResolvedPublic5 Estimated Story Points



  • wbeditentity allows adding and editing of Lexeme forms per the same business logic implemented in wbladdform & wbleditformelements
    • forms can be editited as properties of Lexeme (using lexeme id [e.g. L1] as entity identifier to wbeditentity)
    • individual forms can be editited as form entities (using form id [e.g. L1-F2] as entity identifier to wbeditentity)
  • id is used instead of formId to identify forms inside wbeditentity (forms[]{ id: ... }), wbladdform, wbleditformelements


  • Rename of formId to id was done for wblremoveform in T189673 /
  • RemoveFormConstraint::many() describes (parts of) a Lexeme entity, not only the forms part as the name suggests. To allow for more actions (add, edit), this should be split - e.g. a collection in RemoveFormConstraint::many(), and a LexemeConstraint that describes the properties and different (action) constraints for them

Event Timeline

Restricted Application added a subscriber: Aklapper. · View Herald Transcript

As it came out in the discussion documented in T190060 I note that it was decided that single representation should be represented using a structure: { "language": "en", "value": "colour" }. Note the "value" property being used instead of "representation".
That structure is intended to be used in all API dealing with doing changes to a form, i.e. not only wbeditentity, but also wbladdform, and wbleditformelements.

Change 431530 merged by jenkins-bot:
[mediawiki/extensions/WikibaseLexeme@master] FormStore: Encapsulate logic used to update forms

Change 431791 had a related patch set (by Pablo Grass (WMDE)) published:
[mediawiki/extensions/Wikibase@master] ChangeOps: Add exception type for apply-time

Change 431791 merged by jenkins-bot:
[mediawiki/extensions/Wikibase@master] ChangeOps: Add exception type for apply-time

This is almost done. One bug fixing patch (not handling the error in a particular use case) still awaits review before this goes to product review: