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

UniqueEntityValidator error ? #16791

Copy link
Copy link
Closed
Closed
Copy link
@poolerMF

Description

@poolerMF
Issue body actions

hello ... I'm using SYMFONY 2.7.3, my situation:

validation.yml

XYZ/SubjectData:
    constraints:
        - Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity:
            fields: [client, name, regid, taxid, vatid, registerNumber]
            message: client.not_unique
            errorPath: regid
            groups: [create, update]

creating form:

$form = $this->createForm('subject_data_type', $object, ['addClient' => false, 'addValidFrom' => true, 'submitButton' => true, 'validation_groups' => ['create']]);
  1. Iadd bullshit to validation fields (not mapped field) .. for example: "awegresg"
  2. I set form to existed data
  3. validation passed and SQL error occured (not unique entity)

I also see, that in UniqueEntityValidator, lines 89->91:

if ($constraint->ignoreNull && null === $criteria[$fieldName]) {
    return;
}

why return ? why not continue ??

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.