[AdminList] Form errors
dannyvw opened this issue · comments
Danny v W commented
Not all form errors are visible in an admin list. Validation for the name field is visible but the collection is not. The symfony toolbar shows the validation error for both fields. The same form type on a Node works.
final class FormType extends AbstractType
{
public function buildForm(FormBuilderInterface $builder, array $options): void
{
$builder->add('name', TextType::class, [
'required' => true,
]);
$builder->add('tags', CollectionType::class, [
'entry_type' => TextType::class,
'entry_options' => [
'constraints' => [
new NotBlank(),
],
],
'allow_add' => true,
'allow_delete' => true,
'attr' => [
'nested_form' => true,
'nested_deletable' => false,
],
]);
}
}