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

Bug - validation - email #12

Open
thim81 opened this issue Jun 2, 2016 · 7 comments
Open

Bug - validation - email #12

thim81 opened this issue Jun 2, 2016 · 7 comments

Comments

@thim81
Copy link

thim81 commented Jun 2, 2016

When trying the validation configuration

 #validate imported data
            validation:
                source:                     #add constraints to source fields
                    header1: email
                    header2: notempty
                target: ~                   #activate validation against generated object from object-factory (via annotations, xml)
                                            #or supply list of constraints like in source

The cmd outputs the following error:

 [Symfony\Component\Debug\Exception\ClassNotFoundException]  
  Attempted to load class "email" from the global namespace.  
  Did you forget a "use" statement?           

Part of the stack trace

    1.6576   33232264   7. Mathielen\ImportEngineBundle\Command\ImportCommand->execute() /Users/tim/Sites/webapp/vendor/symfony/symfony/src/Symfony/Component/Console/Command/Command.php:257
    1.6577   33233448   8. Mathielen\ImportEngineBundle\Command\ImportCommand->import() /Users/tim/Sites/webapp/vendor/mathielen/import-engine-bundle/Mathielen/ImportEngineBundle/Command/ImportCommand.php:66
    1.6590   33388040   9. Symfony\Component\DependencyInjection\Container->get() /Users/tim/Sites/webapp/vendor/mathielen/import-engine-bundle/Mathielen/ImportEngineBundle/Command/ImportCommand.php:92
@thim81
Copy link
Author

thim81 commented Jun 6, 2016

Same issue for "notempty"

Attempted to load class "notempty" from the global namespace.

Any idea what I'm missing?

@thim81
Copy link
Author

thim81 commented Jun 6, 2016

Markus,

Can you tell me if I need to include a class for the validation?

@mathielen
Copy link
Owner

Gimme a sec, I look into it

@mathielen
Copy link
Owner

Yea, its bug...

@mathielen
Copy link
Owner

Ok, so for now I have fixed the bundle to look for a service-reference named after the validation's name. That means you have to add a service of a class that extends \Symfony\Component\Validator\Constraint and named after the validation-type (for example: email).

I check if there is a more convenient way to reuse the logic of symfony-validator to automatically create constraints by name.

@thim81
Copy link
Author

thim81 commented Jun 6, 2016

Should I pull the master? Or you prefer to keep using the releases?

@mathielen
Copy link
Owner

For now, please use dev-master.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants