0

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.

František Heča
  • 386
  • 3
  • 16

2 Answers2

0

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

Community
  • 1
  • 1
Nikunj Kabariya
  • 840
  • 5
  • 14
0

try adding required option to your easy admin type settings

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

Yosra Hamza
  • 529
  • 3
  • 5
  • Thank you. It could hack some problems when you really need all the translatable properties required. But doesn't solve proper assertion execution (NotNull, NotBlank, Length etc.). – František Heča Feb 28 '17 at 14:17