Closed youngdolphin closed 4 years ago
It is actually a different bug, the modal to add a new entity works only the first time you open it, then if you want to add a new entity in the same admin page it stops to work (this bug is in ModalListType and in the ModalType too).
Environment
CMS built using Symfony 3.4 and Sonata Admin.
Sonata packages
Symfony packages
PHP version
Subject
I have an entity with a property with a ManyToOne relation to another entity. It works fine and if i use the ModelType in the property i can see the right result of the ChoiceFieldMaskType in the modal to add a new entity. The problem is that if i use ModelListType instead of ModelType and i try to add a new entity, the tab with the form to add the new Step does not consider ChoiceFieldMaskType and shows every property of the entity. (This bug is probably related to https://github.com/sonata-project/SonataAdminBundle/issues/4911)
Steps to reproduce
Create two entity, one refers to the other with a ManyToOne (or OneToOne) relation and uses ModelListType in the admin, and the other has a field using ChoiceFieldMaskType in the admin. Then, in the admin, click the add button to add a new entity in the ModelListType menu.
Expected results
The add modal shows only the properties based on ChoiceFieldMaskType.
Actual results
The add modal shows every property of the entity.
Thanks