Thanks to visit codestin.com
Credit goes to github.com

Skip to content

[Form] Improve handling of unset attributes when using "group_by" on entity field type #5494

Closed
@cmorellirv

Description

@cmorellirv

When using the "group_by" option on the entity field type, it correctly groups choices together under an empty optgroup when the "group_by" property path doesn't exist (when an InvalidPropertyException is thrown).

However, when the property does exist on the entity, but the value is null, the PropertyPath class throws an UnexpectedTypeException, which isn't caught by the ObjectChoiceList class.

The UnexpectedTypeException seems to be the correct exception to be thrown (given the purpose of the PropertyPath class), so maybe this should be caught by the field type class?

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