-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
UniqueEntityValidator error ? #16791
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Why would you not return in that case? I mean it iterates over all fields that are specified to be unique ;) So your unmapped "awegresg" field will not be one of them. Where is your |
In my described case ignoreNull is true and fields contains unmapped "awegresg". Description of ignoreNull in documentation: ignoreNull I think this description do not fit the code I see in UniqueEntityValidator. Maybe I do not understand to this parameter "ignoreNull" from description, but I think it all should work in these way:
So .. when I just change return to continue, all this works and I'm getting Exception "The field "awegresg" is not mapped by Doctrine, so it cannot be validated for uniqueness" There is also no problem with file validation.yml (file is correctly loaded) |
I agree with @poolerMF. The exception should be thrown. |
@poolerMF sorry now I understand what you mean. I agree and it should indeed always throw the exception in case an unmapped field is in the list. Lets say we have a class This record is already in the database: If we now validate the record |
@xabbuh I looked at it ... now it should be OK |
@poolerMF I just reopen here as that PR isn't merged yet (we will close it when the PR is merged). :) |
…(xabbuh) This PR was merged into the 2.7 branch. Discussion ---------- [DoctrineBridge] always check for all fields to be mapped | Q | A | ------------- | --- | Branch? | 2.7 | Bug fix? | yes | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | #16791 | License | MIT | Doc PR | Commits ------- 1e3421d always check for all fields to be mapped
hello ... I'm using SYMFONY 2.7.3, my situation:
validation.yml
creating form:
I also see, that in UniqueEntityValidator, lines 89->91:
why return ? why not continue ??
The text was updated successfully, but these errors were encountered: