Why errors from custom validation constrain not attached to specific field by to the form?

后端 未结 2 2051
盖世英雄少女心
盖世英雄少女心 2021-01-07 10:11

I have an ArticelPattern class which has $extraPatterns property. This property is an array of ExtraPattern (class) elements.

There is a custom constraint on the cla

2条回答
  •  长情又很酷
    2021-01-07 10:21

    Belongs to similar problem: use firstName in your entities and forms. Not first_name.

    If your entity (User) has field like firstName, form builder accepts form_field (with underscore) field naming. It saves data correctly and so on. But if you would add some custom constraint to this field, be careful with underscore: don't use it. Use camelCaseFieldNames insted or you'll get errors attached to form, not to field.

提交回复
热议问题