Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

[Form] Separate errors and display errors #9994

Copy link
Copy link
Closed
@webmozart

Description

@webmozart
Issue body actions

I would like to separate errors and "display errors" in the form component. Therefore I would like to add two methods to FormInterface:

public function getDisplayErrors($deep = false, $flatten = true);

public function addDisplayError(FormError $error);

The idea is that getDisplayErrors() should return the errors that should be displayed on a given form, while getErrors() should only return the errors that were actually caused by the field. In this way, it will be possible to distinguish really erroneous fields from those that only display errors of other fields (#6001).

To make that work, I would like to deprecate the "error_bubbling" option and introduce an equivalent option for the addDisplayError() method. The option should control the following:

  • either errors are displayed at the field they are created on (the default)
  • or they are displayed on the containing form

What should we call this option? "display_errors"?

$builder->add('field', 'type', array(
    // show errors on the field
    'display_errors' => true,
    // show errors on the form
    'display_errors' => false,
));

Unfortuantely we cannot continue to use "error_bubbling", because then we need to break BC.

gmponos

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      Morty Proxy This is a proxified and sanitized view of the page, visit original site.