Closed VincentLanglet closed 3 years ago
Maybe need no process entity if them will be deleted?
Maybe need no process entity if them will be deleted?
If you have any idea about how, and wanna make try. I'll be happy to see how you would implement it
Bug in appending (see ResizeFormListener::preSubmit
) to removed
in one event. And actually remove in other (see ResizeFormListener::OnSubmit
).
Set null occurs between dispatch this events here: https://github.com/symfony/symfony/blob/b3a1851d43617c88aff68948554b0398fcdab07e/src/Symfony/Component/Form/Form.php#L620-L643
Detalied error description:
1) Method Form::submit
dispatches PRE_SUBMIT
on line 555. (ResizeFormListener
adds item to removed
)
2) Method Form::submit
trying set data on line 628.
3) Method Form::submit
dispatches SUBMIT
on line 641. (ResizeFormListener
do remove)
In think that right solution is:
a) Do remove in PRE_SET_DATA.
b) Delete removed
property and other foo code.
Same problem in symfony component: Remove data in onSubmit
():
Symfony\Component\Form\Extension\Core\EventListener\ResizeFormListener
Same problem in symfony component: Remove data in
onSubmit
():Symfony\Component\Form\Extension\Core\EventListener\ResizeFormListener
Maybe this issue could be created on Symfony repository then. You could provide a way to reproduce it.
Environment
Sonata packages
Subject
When using a oneToMany, if you delete a line, fields are not required anymore. But when I submit this form, I get an error because the form is trying to set the
null
BEFORE removing the entity ; and my setter doesn't acceptnull
.