Kunstmaan / KunstmaanBundlesCMS

An advanced yet user-friendly content management system, based on the full stack Symfony framework combined with a whole host of community bundles. It provides a full featured, multi-language CMS system with an innovative page and form assembling process, versioning, workflow, translation and media managers and much more.

Home Page:https://kunstmaancms.be

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[AdminList] Form errors

dannyvw opened this issue · comments

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,
            ],
        ]);
    }
}