Hello, my first attempt to merge into sonata project community. Ive encountered issue when list inline forms does not respond to any validations nor transformers.
This line should be replaces with something like
https://github.com/sonata-project/SonataAdminBundle/blob/74de207a48abc2d58233d66deb2392cb58c3e95b/src/Controller/HelperController.php#L312
$form = $admin->getForm();
$form->setData($object);
$form->submit([$field => $value], false);
should be replaced with
$violations = $form->getErrors(true);
What are your thoughts? Have not tested it properly, but if you approve it is a good idea I will make proper PR.
I had a quick look at the code, and couldn't find a reason to not to do as you said. Maybe there is a reason, but I don't know, so I'd be ok with your PR. If it causes issues, we will simply revert it, and add a comment to explain why it is like this this time.
This needs a little bit of testing. When doing #4992 I tried your solution and got csrf token problems and missing fields when validating form.
Ok to do it, but it will need proper testing on real apps :)
Problem with this thing is that it depends on Admin Form and not Entity form. What Ive tried to say is that injecting data directly into object is bad. You miss every data transformer and validation attached to that field. I do not say my solution is good or best, but I see a problem. Ofc it needs testing and Im currently working on a project with my solution attached, so I will update this thing as I encouter any issues. Currently if I follow Admin Form created on configureFormFields everything works. Ill test this on a bigger scale soon and will add PR if everything turns out OK.
I did a link with the #3717 because those issues look similar.
I have been testing validations with inline edit, and it works, but maybe it is related to the usage of validation groups. The other issue contains a bit more info about validations, but I prefer to keep only this one opened.
Is this still relevant? If so, what is blocking it? Is there anything you can do to help move it forward?
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.
Most helpful comment
Problem with this thing is that it depends on Admin Form and not Entity form. What Ive tried to say is that injecting data directly into object is bad. You miss every data transformer and validation attached to that field. I do not say my solution is good or best, but I see a problem. Ofc it needs testing and Im currently working on a project with my solution attached, so I will update this thing as I encouter any issues. Currently if I follow Admin Form created on configureFormFields everything works. Ill test this on a bigger scale soon and will add PR if everything turns out OK.