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

Most upvoted comments

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:

Admin.add_pretty_errors = function () {};