Closed
Description
With the simple case of 2 entities with a manyToMany relation. If we use a form field not multiple to set the relation, the PropertyAccess throw an exception :
Neither the property "groupes" nor one of the methods "addGroup()"/"removeGroup()",
"addGroupe()"/"removeGroupe()", "setGroupes()", "groupes()", "__set()" or "__call()" exist
and have public access in class "AppBundle\Entity\User"
But if we look at the Entity, the methods addGroupe
and removeGroupe
exists and are public.
The exception is raised because in the method writeProperty
these too methods are used only if the value is an array or traversable witch is not the case if the form field is not multiple.
It would be more easy to debug this situation if we check the presence of the adder and remover methods. Then if this too methods exists the exception should point the fact that in this situation, the expected value is an array or a traversable instance.