Skip to content
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

Unable to access "form.factory" service from Symfony 6 in ResourceController #711

Open
h3llr4iser opened this issue May 12, 2023 · 0 comments

Comments

@h3llr4iser
Copy link

h3llr4iser commented May 12, 2023

Sylius resource bundle version affected: v1.10.2

Description
After upgrading to Symfony 6, an issue has arisen related to the "form.factory" service. This service is no longer public and cannot be retrieved directly from the container. This change is causing an error in the createForm method when I extend from ResourceController, which tries to fetch "form.factory" directly from the container.

ControllerTrait.php

Steps to reproduce
Upgrade to Symfony 6.
Use any controller that extends ResourceController and calls the createForm method.
Attempt to load a page that uses the controller.

Possible Solution
Update ResourceController (or ControllerTrait) to use dependency injection for accessing the "form.factory" service, instead of fetching it directly from the container. This change will align the code with Symfony's latest practices and ensure compatibility with Symfony 6.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant