Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Re-adding , '@session.flash_bag'#15184

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Closed
ThomasLandauer wants to merge1 commit intosymfony:5.2fromThomasLandauer:patch-10

Conversation

@ThomasLandauer
Copy link
Contributor

It was there in 4.4:https://symfony.com/doc/4.4/session.html#basic-usage
But when I omit it, I'm getting (Symfony 5.2):

Circular reference detected for service "session", path: "session -> session.flash_bag -> session".

TODO: PHP config is missing for this code block. I'm doing it like this - should I make a PR? (But I don't know the XML way)

usefunctionSymfony\Component\DependencyInjection\Loader\Configurator\service;useSymfony\Component\HttpFoundation\Session\Attribute\NamespacedAttributeBag;useSymfony\Component\HttpFoundation\Session\Session;$services->set('session', Session::class)->public()->args([service('session.storage'),service('session.namespacedattributebag')]);$services->set('session.namespacedattributebag', NamespacedAttributeBag::class);

It was there in 4.4:https://symfony.com/doc/4.4/session.html#basic-usageBut when I omit it, I'm getting (Symfony 5.2):> Circular reference detected for service "session", path: "session -> session.flash_bag -> session".TODO: PHP config is missing for this code block. I'm doing it like this - should I make a PR? (But I don't know the XML way)```phpuse function Symfony\Component\DependencyInjection\Loader\Configurator\service;use Symfony\Component\HttpFoundation\Session\Attribute\NamespacedAttributeBag;use Symfony\Component\HttpFoundation\Session\Session;$services->set('session', Session::class)->public()->args([service('session.storage'), service('session.namespacedattributebag')]);$services->set('session.namespacedattributebag', NamespacedAttributeBag::class);```
@ThomasLandauer
Copy link
ContributorAuthor

Actually, I'm not sure anymore about this. When passingsession.flash_bag, I'm getting:

User Deprecated: Since symfony/framework-bundle 5.1: The "session.flash_bag" service is deprecated, use "$session->getFlashBag()" instead.

But when not passing it, I'm getting the circular reference exception (see above), which should have been fixed bysymfony/symfony#36261

So what's the status now?

@wouterj
Copy link
Member

I'm closing here, it seems like another contribution was merged that re-added the@session.flash_bag service. And the feature itself was deprecated in 5.x and removed in 6.0 (refsymfony/symfony#32616 ), given its bad DX and small use-case.

@wouterjwouterj closed thisSep 4, 2022
@ThomasLandauerThomasLandauer deleted the patch-10 branchSeptember 4, 2022 15:56
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

No reviews

Assignees

No one assigned

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

3 participants

@ThomasLandauer@wouterj@carsonbot

[8]ページ先頭

©2009-2025 Movatter.jp