-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
Bug with constraint attach to a field ( using @Assert\True() annotation ) #18700
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
@AdriwanKenoby Can you fork the Symfony Standard Edition and make the changes that are needed to reproduce your issue? |
I think its a symfony bug but it can be an Oro platform issue. My code is available on http://gitlab.sinabs.ovh/orocrm-projects/sinabs-orocrm/ |
@AdriwanKenoby Sorry, but we cannot check your whole project. Stripping it down to a minimal set of changes to reproduce your issue or providing a failing test case is the only way I see to help you with your issue. |
@AdriwanKenoby any chance to get what xabbuh's asking for please? |
Sorry for the time, i have found a workaround to my problem, i write a custom validator and declare it as a service, then i use callbak annotation to validate my field. My code is no longer public on gitlab, so I build a minimal project symfony with the bug i had found, i attach it to this message. Their is an entity named Test with a field named url. The method named isUrl return always false, even if it should return true. If i named this method isTestValid, it works. |
I just tried to replicate that issue and I can confirm it, however I'm not sure if it can be easily fixed. Issue here is when there is an entity validated that have both In @AdriwanKenoby example there was form field Here you can find forked symfony-standard showing the issue: jzawadzki/symfony-standard@ec00a7b |
Thank you @AdriwanKenoby for the bug report and thank you very much @jzawadzki for investing the time into find out what went wrong. I was now able to reproduce the issue and create a patch for it in #21115. Can you please try it out and confirm that that PR fixes your issue? |
@AdriwanKenoby Can you confirm that @xabbuh's PR fixes your issue? |
This PR was merged into the 2.7 branch. Discussion ---------- [Validator] do not guess getter method names | Q | A | ------------- | --- | Branch? | 2.7 | Bug fix? | yes | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | #5219, #18700 | License | MIT | Doc PR | TODO Commits ------- bd3a90a [Validator] do not guess getter method names
When I try to add a custom constraint for a specific field with a method, the return statement is always false.
The same method use to verify form globaly works nice.
This method was named isUrl() in my case and verify if an url is online ( i check the header code with a curl request ).
I thought it was because i use the specific word "url" which could be use in otherway. But even if I change "url" in "path". I have the same issue.
The text was updated successfully, but these errors were encountered: