I have a form in Symfony 2.7.10 which definition looks like this:
Ok, I solved it.
My mistake was to not provide information about mealSchema
field in my entity when asking on stackoverflow. If I'd do that then I would realise that the entity field is in fact a smallint
.
My colleague wanted to emulate a MySQL "SET" field type in Doctrine so he used an array as entrypoint values and converted it to bit values in setter method (and the other way around in the getter method).
That's why none of the choice-related validation rules worked. For now, I've made 2 quick solutions:
Change all fields' names in RecipeType from underscore to camelCase because that is how they are named in our entity. This helped for the error being attached to the form instead of the field.
Used a NotNull
validator because the default value of mealSchema
was null
, not an empty array.