Active
Project:
Inline Entity Form
Version:
8.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Plan
Assigned:
Unassigned
Reporter:
Created:
15 Mar 2016 at 11:30 UTC
Updated:
16 Mar 2016 at 11:56 UTC
Jump to comment: Most recent
The complex widget uses $form_state['inline_entity_form'][$ief_id]['entities'].
The simple widget uses $form_state['inline_entity_form'][$ief_id]['entity'].
WidgetSubmit:;doSubmit() only covers $form_state['inline_entity_form'][$ief_id]['entities'], by accident.
(No bugs visible because the simple widget doesn't support deletion and closing entity forms).
Furthermore, each inline form has #entity, which also contains the entity being edited.
I'm pretty sure that needlessly ends up in form cache as well.
We need to unify all this, and build an abstraction around it, instead of fishing around $form_state.
Perhaps using the tempstore actually makes sense?
Comments
Comment #2
bojanz commentedThe first step is removing all IEF form state usage from the IEF form element. It's a form element, it has #default_value and #value, it doesn't need anything else.
Then we fix the Simple widget to stop using the non-standard form state key (leaving us only with the Complex variant).
Opened an issue for that: #2687653: Remove IEF form state usage from the form element, simple widget.
The second step is then to wrap the form state operations as used by Complex in an object.
The third step would be to investigate tempstore (which would also allow people to build dialog based inline forms).
Comment #3
bojanz commentedComment #4
bojanz commented#2687653: Remove IEF form state usage from the form element, simple widget and #2688351: Remove IEF form state specific code from EntityInlineForm are done.
We now only use the form state in the Complex widget. What remains is the refactoring.