Open eotin opened 4 years ago
I have this issue too... I found https://github.com/EasyCorp/EasyAdminBundle/issues/581 so far, where I found https://github.com/EasyCorp/EasyAdminBundle/issues/581#issuecomment-158626018 But the method is still there... and it would always transform the new value to a bool...
If I interpret that correctly, this ajaxEdit is only ment to be used for those checkbox boolean values within the index views for example... Other use cases might not be supported yet...
Any news on this one ? Seems the problem is still here in v4
Describe the bug
As explained here https://symfony.com/doc/current/form/dynamic_form_modification.html
I used to use an ajax function on my edit form to refresh items in a list depending another one on the page. I'm using the
$builder->addEventListener(FormEvents::PRE_SET_DATA,
and$builder->addEventListener( FormEvents::SUBMIT,
Then i need a javascript part to submit the form and replace the items when getting the response :
On the new form, there is no issue as there is no ajaxEdit function called in the new function of the CrudController. But on the edit form, it generates an error because of this part of code :
What is the best way to keep this fonctionnality on the edit form of the bundle ?
Thanks
To Reproduce Steps to reproduce this error and also, the EasyAdmin version used.
(OPTIONAL) Additional context If they are useful, include logs, code samples, screenshots, etc.