sonata-project / twig-extensions

Sonata twig extensions
https://docs.sonata-project.org/projects/twig-extensions
MIT License
85 stars 15 forks source link

"session" service is deprecated #220

Closed yann-eugone closed 3 years ago

yann-eugone commented 3 years ago

Feature Request

Looks like FlashManager is not Symfony 5.3 ready.

Spotted during automated tests :

Since symfony/framework-bundle 5.3: The "session" service and "SessionInterface" alias are deprecated, use "$requestStack->getSession()" instead. It is being referenced by the "sonata.twig.flashmessage.manager" service.

If this is something you are interested with, I can create a PR :

I would replace session dependency with RequestStack, and get session from main request (or master, depending on Symfony's version) in the getSession method.

franmomu commented 3 years ago

If this is something you are interested with, I can create a PR

sure! it would be great, thank you!

VincentLanglet commented 3 years ago

In order to be BC, he has to support both Session and RequestStack as first param of the constructor. And we will remove the Session support in next major.