E41B [Form][Choice] If invalid value submitted radio\checkbox fields behavior not consistent with select one. · Issue #6352 · symfony/symfony · GitHub
[go: up one dir, main page]

Skip to content

[Form][Choice] If invalid value submitted radio\checkbox fields behavior not consistent with select one. #6352

@makasim

Description

@makasim

If invalid value submitted the select choice throws an exception TransformationFailedException where radio\checkbox choices set the value to NULL.

This behavior cause some problems at validation stage.

  • First one is Choice constraint. It do nothing for NULL values.
  • Next problem more serious. If you dont have NotBlank constraint at the field you will pass validation with NULL value where someone would expect a value from choice set.

Personally I prefer TransformationFailedException for such cases.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0