Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[AdminList] Form errors #3317

Open
dannyvw opened this issue Nov 1, 2023 · 0 comments
Open

[AdminList] Form errors #3317

dannyvw opened this issue Nov 1, 2023 · 0 comments

Comments

@dannyvw
Copy link
Contributor

dannyvw commented Nov 1, 2023

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,
            ],
        ]);
    }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant