FriendsOfSymfony / FOSCommentBundle

Threaded comments for Symfony
http://friendsofsymfony.github.com/
MIT License
462 stars 230 forks source link

Use the correct Symfony Controller class based on Symfony version #671

Closed snebes closed 5 years ago

snebes commented 5 years ago

Would you consider using the following PR to allow Symfony 4.x and eventually 5.x to maintain compatibility with Symfony 2.8, assuming support is still planned legacy Symfony versions.

XWB commented 5 years ago

As AbstractController uses a limited container, are you sure that all $this->container->get calls will continue to work?

snebes commented 5 years ago

I don't believe Symfony has put an expiration date on when the container in AbstractController will go away, but they strongly recommend using service injection over using get.

I'll be glad to reconfigure the controller that way if you want.

XWB commented 5 years ago

@snebes I'm fine with the current PR, as long as we don't get errors like https://stackoverflow.com/questions/48740064/symfony-4-knppaginator-bundle-service-not-found-even-though-it-exists-in-app ?

XWB commented 5 years ago

Reverted, this change is causing other issues that I don't know how to resolve.

25x: Auto-injection of the container for "FOS\CommentBundle\Controller\ThreadController" is deprecated since Symfony 4.2. Configure it as a service instead.