doctrine / doctrine/DoctrineModule

UniqueObject Validators doesn't work if you give the column a different name, than the fields name.

Open
#377 12 comments 0 reactions 0 assignees View on GitHub
Bug
Dominant language
PHP
Stars
392
Forks
263
PR merge metrics
No merged PRs in 30d

Description

UniqueObject Validators doesn't work if you give the column a different name, than the fields name.

So, if you have an user entity with id as identifier and name the column like 'user_id' (so, the webform also contains a field names 'user_id' the validator will fail at`

``` php
if (!isset($context[$columnName])) {
```

because, there is no 'id' (but 'user_id') in the form.

So, as renaming columns is a supported behaviour shouldn't the UniqueObject validator rely on the choosen/given columnName?

If have a working example here, but don't know, if it is correct in all ways...
Could make a pull request for that.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.