Closed digitalkaoz closed 9 years ago
Same problem here. I was able to generate different add buttons for each subclasses by overriding the edit_orm_one_to_many template but of course it's not enough since the controller doesn't handle this case. The problem only occurs if you want to be able to add any type of children in your collection. If you only need to add ValueFilter objects, you can fix the problem by specifying 'type_options' => ['data_class' => '\Dl\Component\DomainModel\Filter\Condition\ValueFilter'] when creating your form.
Nope this doesn't fix it.
@Tofandel can you elaborate or do you have a fix which you could provide in a PR?
Well, there is still the same Add button in inline (so no dropdown) and so it's still throwing the same error: Cannot initialize abstract class. I tried a lot of things and I can't find a way to get the dropdown, so the only thing that does work is displaying it in a modal.
I also have an issue with my sonata_entity_collection, once it has childrens, it's not displayed correctly on the page :
I would expect a button to open a modal to edit the Children, but instead I just get all of the fields within the parent form and it's all a big mess. Not really related, but do you happen to know where could I be doing something wrong ? Maybe some twig form_theme config I'm missing, but I can't find it documented, thanks.
if a relation points to an entity with a discriminator map, the "Add" Button doesnt work, because it tries to create the abstract parent class:
i have admins for both and linked the childs into the parent:
when using the from the "List View" the Menu Drop Down behaves correct, and gives me a "Add ValueFilter" Button to create a new Value Filter.
But when using it from within a form like this:
i get an add button, but that wont work as the parent class is abstract...best would be the same dropdown like in the list view, or multiple buttons for each subClass.
Maybe im doing it wrong? Any Help?