-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
Readd 'form_label_errors' block to disable errors on form labels #26408
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
Conversation
Thank you for this PR. Btw, This is a feature and not a bug. Protip: There is no need of closing the PR and open a new one. Just push your changes to the same branch and the PR will be updated. |
Made the previous pull request in the wrong branch and it collects all the differences & shown as comments... that's why I prefer to close it & open another one. Thanks! |
@Nyholm This a is a new feature that we want to introduce in the 3.4 branch, shouldn't it go to master instead ? |
@birkof Thanks for the first contribution on symfony! ;) |
Okey, Lets consider it a bugfix then. It is for users that does not use |
If somebody needs to do this on per-field basis, this is better approach: {{ form_label(addUserForm.userByEmail, null, {errors: []}) }} If you want to disable all errors for form, you can currently do this: {% form_theme addUserForm _self %}
{% block form_errors %}{% endblock %} This PR is still a bit different though, because someone might want to disable errors in labels, but not errors via |
Exactly. The point is not to disable errors. The point is to disable errors in labels. |
@ostrolucky didn't know you could disable errors per-field like that. Thanks for the hint! |
As form_errors call was removed from form_row in this commit, will disabling errors in labels cause error blocks to be not rendered at all? A simple way to restore old behavior could be useful as errors in labels don't play nice with some Bootstrap 4 themes. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Im 👍
Thank you @birkof. |
…orm labels (birkof) This PR was merged into the 3.4 branch. Discussion ---------- Readd 'form_label_errors' block to disable errors on form labels | Q | A | ------------- | --- | Branch? | 3.4 | Bug fix? | no | New feature? | yes <!-- don't forget to update src/**/CHANGELOG.md files --> | BC breaks? | no <!-- see https://symfony.com/bc --> | Deprecations? | no <!-- don't forget to update UPGRADE-*.md files --> | Tests pass? | yes <!-- please add some, will be required by reviewers --> | License | MIT Re-added **form_label_errors** block on bootstrap 4 form themes. You can disable errors shown on form labels by simply extend bootstrap4 layout and empty **form_label_errors** block. See below: ``` {% use "bootstrap_4_layout.html.twig" %} {# Disable errors shown on form labels #} {% block form_label_errors %}{% endblock form_label_errors %} ``` Block previously removed [here](b375957#diff-62cb2a10f5a37db0e87e3bd81609b17dR186) by @nicolas-grekas. cc @Nyholm Commits ------- 5b4354f Readd 'form_label_errors' block to disable errors on form labels
Re-added form_label_errors block on bootstrap 4 form themes.
You can disable errors shown on form labels by simply extend bootstrap4 layout and empty form_label_errors block. See below:
Block previously removed here by @nicolas-grekas.
cc @Nyholm