Skip to content

\Symfony\Bridge\Doctrine\Form\ChoiceList\ORMQueryBuilderLoader::getEntitiesByIds doesn't filter invalid UUIDs #17488

Closed
@paulferrett

Description

@paulferrett

When using the default Doctrine EntityType in Forms, invalid GUID/UUID values (e.g. "", "asdf", 1) are being run through the database, which causes exceptions when using PostgreSQL

If an invalid UUID is submitted in a form (including empty values, which ends up being sent to Postgres as "") an exception is thrown, e.g.

SQLSTATE[22P02]: Invalid text representation: 7 ERROR:  invalid input syntax for uuid: \"\"

The class already filters out non-int values for single int id entities for the same reason; because it causes an error on Postgres (see commit 45579fd). So it makes sense to me to run a similar check for valid UUID values.

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