Problem/Motivation
Looking at EntityForm, i notice there is 2 way to build forms.
- calling buildForm()
- calling form()
There is no documentations about this 2 methods and which one should be used to make your own form.
buildForm() is implemented by FormBase. It's called first and call EntityForm::form() in EntityForm::buildForm(). EntityForm::buildForm() make additionnal stuff on form generated by EntityForm::form() like adding actions to form.
So i think building form for custom entities should be done in form().
There is no documentation about EntityForm::form() and, more important, this method is not defined in EntityFormInterface despite it's mandatory.
Proposed resolution
Add EntityForm::form() to EntityFormInterface and add documentation about this method.
Comment | File | Size | Author |
---|---|---|---|
#2 | add_form_to-2850059-2.patch | 1.85 KB | GoZ |
Comments
Comment #2
GoZ CreditAttribution: GoZ at Centarro commentedComment #3
DuaelFrYour patch is okay but I'd love to have a proper explanation about the use of this method and I think it should be located in this interface.
Comment #13
smustgrave CreditAttribution: smustgrave at Mobomo commentedThis issue is being reviewed by the kind folks in Slack, #needs-review-queue-initiative. We are working to keep the size of Needs Review queue [2700+ issues] to around 400 (1 month or less), following Review a patch or merge request as a guide.
Patch still applies cleanly and just kicked off a D10.1 test.
Moving to NW because also feel if we are going to move this it would be a good opportunity to update the description to better explain what it does.