A2LiX Translations validation not working when all fields are submited as empty

1k Views Asked by At

When I don't provide any of the translatable properties through my submit form, then I get no validation checking, even when I have implemented:

/** * @Assert\Valid */ protected $translations;

In config.yml I have:

default_locale: cs required_locales: [cs]

All topics about this problem were giving importance on the @Assert/Valid on $translations property, which I have implemented (I have even tried validation.yml configuration).

Now I realise, that I forgot to add, that I am displaying and submiting the form through Easy Admin bundle. I am not building the form myself. Just configuring Easy Admin settings for my entity. Maybe there's some glitch.

2

There are 2 best solutions below

0
On

Please refer the following answer link related to same question: Collection array name fields validation: A2Lix form validation for translations field

1
On

try adding required option to your easy admin type settings

- { property: 'translations', type: 'a2lix_translations', type_options: { required: true} }