-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[Form] group_by does not works with callable string #15542
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
But for your concrete use-case, the static method, you can simply use the array notation of it. |
See #15561 for a fix. |
Thanks a lot, for your help. |
fabpot
added a commit
that referenced
this issue
Aug 22, 2015
This PR was merged into the 2.7 branch. Discussion ---------- [Form] only use PropertyPath if not already callable | Q | A | ------------- | --- | Bug fix? | yes | New feature? | no | BC breaks? | could be in edge cases | Deprecations? | no | Tests pass? | yes | Fixed tickets | #15542 | License | MIT | Doc PR | - Currently it uses a PropertyPath even when the string is already a callable. But the callable string should have higher priority since that is also the one documented in ChoiceListFactoryInterface. Commits ------- 470b140 [Form] only use PropertyPath if not already callable
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I tried to use 'group_by' option with a call to a static method.
Here is a dummy code sample of what I'm doing.
I saw in
Symfony\Component\Form\ChoiceList\Factory\PropertyAccessDecorator::createView
line 203, the test isif (is_string($groupBy))
.I think it should be
if (is_string($groupBy) && !is_callable($groupBy))
.I have test with option choice_value, and other new options, but this bug may exists for those ones too.
The text was updated successfully, but these errors were encountered: