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

Skip to content

[Doctrine] [Bridge] UniqueEntity validator should add "{{ value }}" message placeholder #15268

Closed
@jperovic

Description

@jperovic

When validating uniqueness fails, UniqueEntityValidator does not add "{{ value }}" message placeholder, as other validators do.

This might be useful when printing what went wrong during the validation.

So, instead of:

# Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntityValidator 
$this->buildViolation($constraint->message)
                ->atPath($errorPath)
                ->setInvalidValue($invalidValue)
                ->addViolation();

we should probably have:

# Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntityValidator 
$this->buildViolation($constraint->message)
                ->atPath($errorPath)
                ->setParameter('{{ value }}', $invalidValue)
                ->setInvalidValue($invalidValue)
                ->addViolation();

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