I have a ManyToMany association in my entity and I am trying to edit those entities inline. I am attempting to use sonata_type_collection to display the form,
->add('galleries', 'sonata_type_collection', array(), array(
'edit' => 'inline',
'inline' => 'table',
))
When I render the form, I see INVALID MODE : s5147816d591b7_galleries - type : sonata_type_collection - mapping : 8 instead of the form field.
I've seen similar issues such as #322 but the solution provided there, and every where else I've seen this referenced is a cop out. Instead of rendering the admin fields they are using the default Symfony form behavior as a close enough solution. I want to give users the ability to select existing entities or add new ones. According to the Doctrine2 ORM Admin documentation, the above should have worked.
For anyone else running into a similar issue, this blog post got me close.
too late, 404 error and need this feature ;)
Look at how it's done within SonataMediaBundle, https://github.com/sonata-project/SonataMediaBundle/blob/master/Model/GalleryHasMedia.php.
To be a little clearer, you need to create another Entity that manages the associations between your Entity and the Gallery entities.
thank you
Still relevant six years later guys. If you would like to share a trick would be really appreciated.
You mean 3, right?
I mean 4
I think you meant 5
I spent more than an hour on this in the morning, so I thought I would post what worked for me here, in case others are still encountering this pesky error. See the link below.
Most helpful comment
I spent more than an hour on this in the morning, so I thought I would post what worked for me here, in case others are still encountering this pesky error. See the link below.
https://stackoverflow.com/questions/48823406/invalid-mode-s5a869f19a6c57-equivalents-type-sonata-type-collection-mapp/48827920#48827920