Skip to content
Advertisement

Tag: dynamic-forms

Symfony Forms Error: Entity of type “…” passed to the choice field must be managed. Maybe you forget to persist it in the entity manager

Objective I am trying to make a basic form that signs a new player up for a sport. This is taken from the Symfony example at: https://symfony.com/doc/current/form/dynamic_form_modification.html#form-events-submitted-data The Code I have 3 entities: PlayerList https://github.com/ChimeraBlack1/Symphart/blob/main/src/Entity/PlayerList.php Sport https://github.com/ChimeraBlack1/Symphart/blob/main/src/Entity/Sport.php Position https://github.com/ChimeraBlack1/Symphart/blob/main/src/Entity/Position.php I have a form: NewPlayerType https://github.com/ChimeraBlack1/Symphart/blob/main/src/Form/NewPlayerType.php I have a controller: NewPlayerController https://github.com/ChimeraBlack1/Symphart/blob/main/src/Controller/NewPlayerController.php The Error: Details: I seem to get this error

Advertisement