SonataAdminBundle: Form error messages are removed by javascript
Line 35 of Resources/public/base.js is removing the content of .sonata-ba-field-error-messages, and then no error is displayed when editing or creating an entity. That’s the line:
jQuery('div.sonata-ba-field-error-messages', element).html('');
Which is the purpose of this line? Is it a mistake and should be removed?
About this issue
- Original URL
- State: closed
- Created 12 years ago
- Comments: 16 (9 by maintainers)
Commits related to this issue
- Remove the oh-so-pretty-error feature. Fixes #1076 — committed to ju1ius/SonataAdminBundle by deleted user 8 years ago
- Remove the add_pretty_errors feature. Closes #1076 This feature gathers error messages and shows them in a central place. While making the UI prettier, it makes it less usable, especially for mobile ... — committed to ju1ius/SonataAdminBundle by deleted user 8 years ago
- Merge pull request #3632 from ju1ius/bugfix/remove-pretty-errors Remove the add_pretty_errors feature. Fixes #1076. — committed to sonata-project/SonataAdminBundle by core23 8 years ago
3 years later, this bug still exists.
The
Admin.add_pretty_errors()function blindly removes all errors to try and show them in a popover. Not only does it fail on certain types of fields (most commonly icheck), but hiding errors on a form and showing them on HOVER only is really bad for UX (what about touchscreens, disabled users…)IMO this anti-feature should be removed entirely, as it does more harm than good. And it’s not that pretty.
Here’s a backward-compatible fix: