CQ: Switch core forms to be Entity Forms
We have switched some forms already to use the EntityFormTrait as part of the following goals
- move data about the fields on the forms into the schema xml - this will be important to help us migrate away from quick form
- support custom data on a wide range of entities - several entities already support custom data as a result of having been switched to entity forms - relationship type form, membership status, financial type, price set etc
- support parameters passed through the url in a non ad-hoc way - we have a history of security issues are url parameters so any new retrieval should be stdised & we need to work to remove existing ones
- support extension intervention in the fields displayed - this is particularly supported by the tpl changes in the entity form structure
- generalised reduction in unecessary code
- improving translation consistency
What is involved in the Entity Form is best understood by looking at existing examples but basically it consists of
- using the EntityFormTrait
- ensuring the relevant things are declared on the class to support that
- declaring all the fields that can be added through metadata in the metadata array
- working towards simplifying the tpl to a single line {include file="CRM/Core/Form/EntityForm.tpl"}
Generally in any change we can take steps towards this rather than fully implement it
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information