ddeboer / vatin-bundle

Symfony bundle for the VATIN library
MIT License
28 stars 10 forks source link

Validation of vatin-bundle #7

Closed phpdeveloper1 closed 7 years ago

phpdeveloper1 commented 7 years ago

Using it as a service directly is working for me .But using annotation to validate the property of the model is not working.Any help would be appreciated.

sstok commented 7 years ago

Can you explain what is not working exactly? Error, exception, not performing the validation, anything.

phpdeveloper1 commented 7 years ago

Not performing the validation.No errors or exception.

sstok commented 7 years ago

Are other Constraints properly running? So if you have a NotBlank, leaving the value blank will give a violation.

phpdeveloper1 commented 7 years ago

Yes. Other constraints are running properly.Leaving the value blank is displaying the alert message.

sstok commented 7 years ago

Hmm, checkExistence is set to true so it should work.

@ddeboer Can you confirm the Validator is still working with the latest Symfony version?

phpdeveloper1 commented 7 years ago

I am using symfony 2.8.16 version

ddeboer commented 7 years ago

Ensured compatibility with newer Symfony versions on master. Can you try that and see if it resolves your problem?

phpdeveloper1 commented 7 years ago

Is it enough to modifiy @stable in composer.json as "ddeboer/vatin-bundle" : "^1.0" ?

ddeboer commented 7 years ago

You can (temporarily) switch to master like this:

"ddeboer/vatin-bundle": "dev-master"

and then run composer update.

phpdeveloper1 commented 7 years ago

Thanks for your message.I tried this solution as well.But still it didn't resolve my issue.

ddeboer commented 7 years ago

Not sure what is wrong here. Added a passing functional test to ensure that the @Vatin validation annotation is working. Have a look at the test Model for how to use it correctly.

phpdeveloper1 commented 7 years ago

I am using symfony 2.8.16 version.But in ur composer.json it says 2.7 || 3.0 symfony framework.So is it not supporting 2.8 ?Could that be an issue?

ddeboer commented 7 years ago

It says ^2.7, which includes 2.8. By the way, you can now update to version 2.0.0 of this bundle.

ddeboer commented 7 years ago

We now also have a test against Symfony 2.7, so I’m closing this issue as it seems to be unreproducible. While the most like cause is some issue in your Symfony app config, please feel free to open a PR with a failing test case if you can reproduce your problem.