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

Storage-specific validation not loaded #1498

Closed
Richtermeister opened this issue Jun 3, 2014 · 14 comments
Closed

Storage-specific validation not loaded #1498

Richtermeister opened this issue Jun 3, 2014 · 14 comments

Comments

@Richtermeister
Copy link

I'm probably overlooking something, but it seems that the storage-specific validation rules are not being loaded. Specifically Resources/config/validation/orm.xml.

I see that this validation pass here should be responsible for loading it, but in the highlighted line it checks for a container parameter which does not seem to exist, and I cannot find where it would be set..

if (!$container->hasParameter('validator.mapping.loader.xml_files_loader.mapping_files')) {

In my application config.yml I have:

framework:
    validation:      { enable_annotations: true }

Thank you for any help.

@Richtermeister
Copy link
Author

It seems this might be related to a recent change in the way Symfony loads validation:

symfony/symfony@9b204c9#diff-0e793081ceb720201745c982a568903fL678

@Richtermeister
Copy link
Author

Ok, so this only affects Symfony 2.5 and above. Is this something this FOS bundle should support? Happy to contribute the fix..

@sstok
Copy link

sstok commented Jun 4, 2014

I think so yes, but we should detect if the Kernel version is >=2.5 to not break support for older versions.

@kbond
Copy link

kbond commented Jun 13, 2014

This is fixed in the 1.3.x branch but still needs to be fixed in master.

@stof
Copy link
Member

stof commented Jun 13, 2014

I'm currently working on the merge of 1.3.x into master

@kbond
Copy link

kbond commented Jun 13, 2014

Cool, is it possible to get a new 1.3.x release?

@stof
Copy link
Member

stof commented Jun 13, 2014

done

@stof stof closed this as completed Jun 13, 2014
@Richtermeister
Copy link
Author

Nice @kbond. Thx for fixing. Have a great weekend.

@carakool
Copy link

Hey guys, I checked out the lastest version of the bundle but still the validation is not loading for me. Am I missing something?

@kbond
Copy link

kbond commented Jun 14, 2014

Hmm, I am seeing this as well.. Not sure as to the problem. The validation config is properly being added to validator.builder

@kbond
Copy link

kbond commented Jun 14, 2014

I was able to get it to work by setting the validation api to 2.4 in the config:

framework:
    validation:
        api: 2.4

@carakool can you confirm that this fixes the problem in your project?

I'm thinking this a bug with Symfony. @stof any ideas?

@vincecore
Copy link

see #1511

@Spope
Copy link

Spope commented Jun 16, 2014

Username/Email unique constraint failed since I Updated to symfony 2.5, doctrine was throwing the error instead of the form, and @kbond's solution worked for me.

@carakool
Copy link

@kbond Yes, I confirm your suggestion fixed the issue for me. Thanks!

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

No branches or pull requests

7 participants