Skip to content
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

Trying to load invalid (unavailable) CouchDB UniqueEntity validator #1775

Closed
dannydorfel opened this issue Mar 11, 2015 · 2 comments
Closed

Comments

@dannydorfel
Copy link

Symfony version: Symfony 2.7

Attempted to load class "UniqueEntity" from namespace
"\Symfony\Component\Validator\Constraints\Doctrine\Bundle\CouchDBBundle\Validator\Constraints".
Did you forget a "use" statement for "Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity"?

Calling the register form, the metadata for the user document is created and the metadata loader somehow also loads the couchDB validation constraints. Which aren't present and the loader adds the default validator prefix to the classname declaration. Hence: Symfony\Component...\Doctrine\Bundle...

It seems that the loader behaviour in Symfony2 has changed and also reads all xml files in the validation folder by default. Changing the Resources/config/validation folder would fix the problem.

@stof
Copy link
Member

stof commented Mar 11, 2015

I think this is caused by symfony/symfony#13855, which means that our special validation mapping files are now always loaded by Symfony. We will have to rename the folder indeed

@dannydorfel
Copy link
Author

Indeed, that merge has the same code I traced the issue back to in the FrameworkExtension class.

As a temporary fix, I added a dc compiler pass in my own project removing the unwanted xml files in the arguments of the 'addXmlMappings' call to the 'validator.builder' definition.

stof added a commit that referenced this issue Mar 12, 2015
This PR was merged into the 1.3.x branch.

Discussion
----------

Compatibility with Symfony 2.7 (1.3 branch)

Same as #1776 but on the 1.3 branch.

Commits
-------

f3eb79d Compatiblity with Symfony 2.7. Close #1775.
@stof stof closed this as completed in f3eb79d Mar 12, 2015
adam187 added a commit to adam187/FOSUserBundle that referenced this issue Apr 9, 2015
* master:
  Compatiblity with Symfony 2.7. Close FriendsOfSymfony#1775.
  Update FOSUserBundle.el.yml
tomgud added a commit to HTML24/FoosLeader that referenced this issue Mar 30, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants