-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
FormTypeValidatorExtension uses wrong entity #11036
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
It is not moved. There is a new interface in Symfony 2.5, while the old one is still there. However, it is true that the FormTypeValidatorExtension should be updated to accept both implementations |
I've just updated to Symfony 2.5, and using the new validator with forms is throwing an error related to the expected interface being wrong. I have set my config to As stated above, the Validator is being created using the new classes (implementing By changing the config to |
@cjunge-work given that most bundles still support Symfony 2.3 as it is the LTS, switching to |
@stof Same goes for |
this is messed up then:
related matthiasnoback/symfony-service-definition-validator#12 |
Indeed, the service definitions are invalid here (see the issue that @cordoval pointed to). The I think this should be fixed for consistency sake. I will make a pull request for this later. |
Also to add, using auto api causes errors of different fields to pile up onto a single field, usually the last. 2.4 api doesn't have this issue. |
in my opinion, from the validator is only the validate method used.
and in the new validator since 2.5
So I think we can solve this issue with a code like this:
The instance of checks is not a nice solution, but I works. @webmozart do you have a better solution? I can create a pull request and with tests, if the core members think this could be a solution for the problem. |
We have the same issue here in the EventListener |
@sebastianblum doing instanceof checks in the constructor is the right solution IMO. Can you send a PR fixing it ? |
Yes, I will do it for the FormTypeValidatorExtension and theValidationListener |
@sebastianblum I think #11049 can be solved this way as well. Could you do this for |
…11036 (Sebastian Blum) This PR was submitted for the master branch but it was merged into the 2.5 branch instead (closes #11350). Discussion ---------- [2.5][Form] solved dependency to ValidatorInterface, fix #11036 | Q | A | ------------- | --- | Bug fix? | [yes] | New feature? | [no] | BC breaks? | [no] | Deprecations? | [no] | Tests pass? | [yes] | Fixed tickets | #11036, #11345 | License | MIT | Doc PR | Since Symfony 2.5 The problem was that the form component has a hardcoded depencency to the deprecated validator component (api Version 2.4) The pull request fixes the dependency to the validator component and supports now both implementations, apiVersion 2.5 and apiVersion 2.4 of the validator component. @symfony Core Members please review the changes https://github.com/sebastianblum/symfony/blob/0a1e9c208f8730219bebf89f6696b246a0c88da7/src/Symfony/Component/Form/Extension/Validator/ValidatorExtension.php I'm not sure if it was the right solution Commits ------- 705d67b [2.5][Form] solved dependency to ValidatorInterface, fix #11036
@sebastianblum Thanks! |
…11036 (Sebastian Blum) This PR was squashed before being merged into the 2.6-dev branch (closes #11350). Discussion ---------- [2.5][Form] solved dependency to ValidatorInterface, fix #11036 | Q | A | ------------- | --- | Bug fix? | [yes] | New feature? | [no] | BC breaks? | [no] | Deprecations? | [no] | Tests pass? | [yes] | Fixed tickets | #11036, #11345 | License | MIT | Doc PR | Since Symfony 2.5 The problem was that the form component has a hardcoded depencency to the deprecated validator component (api Version 2.4) The pull request fixes the dependency to the validator component and supports now both implementations, apiVersion 2.5 and apiVersion 2.4 of the validator component. @symfony Core Members please review the changes https://github.com/sebastianblum/symfony/blob/0a1e9c208f8730219bebf89f6696b246a0c88da7/src/Symfony/Component/Form/Extension/Validator/ValidatorExtension.php I'm not sure if it was the right solution Commits ------- ab765c9 [2.5][Form] solved dependency to ValidatorInterface, fix #11036
* 2.5: [Process] Adjust PR #11264, make it Windows compatible and fix CS [Process] Fix unit tests on Windows platform bumped Symfony version to 2.5.3 bumped Symfony version to 2.4.9 bumped Symfony version to 2.3.19 updated VERSION for 2.5.2 updated CHANGELOG for 2.5.2 updated VERSION for 2.4.8 updated CHANGELOG for 2.4.8 [2.5][Form] solved dependency to ValidatorInterface, fix #11036 updated VERSION for 2.3.18 update CONTRIBUTORS for 2.3.18 updated CHANGELOG for 2.3.18 [Process] Use correct test for empty string in UnixPipes Conflicts: src/Symfony/Component/HttpKernel/Kernel.php src/Symfony/Component/Process/ProcessPipes.php
The variable $validator of
Symfony\Component\Form\Extension\Validator\Type\FormTypeValidatorExtension
usesSymfony\Component\Validator\ValidatorInterface
, which is moved toSymfony\Component\Validator\Validator\ValidatorInterface
since Symfony 2.5 . Please change this in this entity.Regards, Tobias Feijten
The text was updated successfully, but these errors were encountered: