You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have an inline admin where I can add new items in a table view. If I press the "add" button then I get a type error since I moved to Symfony 6. It worked fine with Symfony 5.4 as there was no string typehint on Symfony's FormBuilder::get.
From what I can tell we cannot guarantee that $this->iterator->current() within FormBuilderIterator will actually be a string. In my case its an integer and this seems legit. The problematic form field is an expanded choice field with checkboxes and the children of this form are indexed with integers.
I checked it and casting to string there solves the issue for me. Shall I create a PR for this?
Environment
Subject
Type error caused by
FormBuilderIterator
Minimal repository with the bug
?
Steps to reproduce
I have an inline admin where I can add new items in a table view. If I press the "add" button then I get a type error since I moved to Symfony 6. It worked fine with Symfony 5.4 as there was no
string
typehint on Symfony'sFormBuilder::get
.Actual results
A dump of
From what I can tell we cannot guarantee that
$this->iterator->current()
withinFormBuilderIterator
will actually be a string. In my case its an integer and this seems legit. The problematic form field is an expanded choice field with checkboxes and the children of this form are indexed with integers.I checked it and casting to string there solves the issue for me. Shall I create a PR for this?
The text was updated successfully, but these errors were encountered: