-
-
Notifications
You must be signed in to change notification settings - Fork 9.4k
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
[Form][BC-break] choice-list option breaks rendering of the form #15037
Comments
Hi @aledeg, thank you for taking the time to report this problem! Could you please upload a fork of symfony-standard that reproduces your problem? |
Hi @webmozart, I don't understand what you want me to upload. Could you give more information? |
Sure! Go to https://github.com/symfony/symfony-standard and click "Fork" on the top right to fork the Symfony Standard Edition to your own account (see https://help.github.com/articles/fork-a-repo/ for help). Reproduce the bug in this project, commit the code and push the branch to your fork. Then send me a link to your fork and the name of the branch. I will download the branch and should be able to see your bug exactly like you do. :) Better now? |
Thanks for the explanation. |
@webmozart Here is the link to my fork and the name of my branch is form-exception |
+1 - having the same issue. Symfony 2.7.1 |
This PR was squashed before being merged into the 2.7 branch (closes #15546). Discussion ---------- [Form] fixed BC-break on grouped choice lists | Q | A | ------------- | --- | Bug fix? | yes | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | #15037 | License | MIT | Doc PR | Commits ------- 12a7dd1 [Form] fixed BC-break on grouped choice lists
I created a custom type which uses a custom LazyChoiceList object to load my choices. It was working from SF2.4 to SF2.6.
With SF2.7, I got the following error message:
After investigation, the problem comes from the createView method in Symfony\Component\Form\ChoiceList\Factory\DefaultChoiceListFactory.php.
As I am using deprecated code in 2.7, I use the first part of the code. Unfortunately, the closure can not work since it accepts only LegacyChoiceView objects and it receives arrays.
If one change the hint to array, the closure code won't work since an object is needed.
If one change the return type of the method getRemainingView from array to LegacyChoiceView, the array_map won't work since its second parameter must be an array.
I read 2.8 code and this code is still there.
The text was updated successfully, but these errors were encountered: