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

Add cookbook chapter on error_bubbling and dealing with form errors in twig #6145

Closed
webdevilopers opened this issue Jan 14, 2016 · 3 comments

Comments

@webdevilopers
Copy link

@weaverryan from @KnpLabs posted a nice article here:
https://knpuniversity.com/blog/symfony-debugging-form-errors

Originally I came from the following issue: symfony/symfony#17363

The described issue caused a strange effect in which non mapped field errors were linked to the parent form - the same thing that would have happened if you turned error_bubbling to true.

Since this I was able to catch the errors from the form.vars array in my template:

{% if form.vars.errors|length > 0 %}

After i solved the issue the errors were correctly removed from the bubble and attached to the assigned field. My twig condition would no longer work. I had to change it:

{% if not form.vars.valid %}

I've seen a lot of questions on SO on this e.g.:

Actually I havn't found any chapter that explains what error_bubbling is in the first place.
Most of the times it is described directly inside a form field type or collection.

I think the cookbook could really be improved with this. What do you think?

@carsonbot
Copy link
Collaborator

Thank you for this issue.
There has not been a lot of activity here for a while. Has this been resolved?

@carsonbot
Copy link
Collaborator

Friendly ping? Should this still be open? I will close if I don't hear anything.

@webdevilopers
Copy link
Author

I'm no longer working with the Form component. Closing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants