Skip to content

Fix code example: replace request get() with all() method to support non-scalar types #19328

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

Merged
merged 1 commit into from
Dec 24, 2023
Merged

Fix code example: replace request get() with all() method to support non-scalar types #19328

merged 1 commit into from
Dec 24, 2023

Conversation

alejgr
Copy link
Contributor

@alejgr alejgr commented Dec 23, 2023

Method $request->request->get does not support non-scalar types so it won't work with forms since they are received as an array type.

Using get used to work in older Symfony versions but no longer does, now an exception is thrown.

IMO we should use all method instead in this example.

@carsonbot carsonbot added this to the 6.4 milestone Dec 23, 2023
@alejgr alejgr changed the base branch from 6.4 to 5.4 December 23, 2023 17:30
@alejgr alejgr changed the title Fix code example: replace request get() with all() method to support non-scalar types in Forms [Form] Fix code example: replace request get() with all() method to support non-scalar types in Forms Dec 23, 2023
@alejgr alejgr changed the title [Form] Fix code example: replace request get() with all() method to support non-scalar types in Forms [Form] Fix code example: replace request get() with all() method to support non-scalar types Dec 23, 2023
@carsonbot carsonbot changed the title [Form] Fix code example: replace request get() with all() method to support non-scalar types Fix code example: replace request get() with all() method to support non-scalar types Dec 24, 2023
@xabbuh xabbuh modified the milestones: 6.4, 5.4 Dec 24, 2023
@xabbuh
Copy link
Member

xabbuh commented Dec 24, 2023

Thank you @alejgarciarodriguez and congratulations on your first Symfony docs contribution!

@xabbuh xabbuh merged commit 5fb46a1 into symfony:5.4 Dec 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants