8000 merged branch jmikola/logout-csrf (PR #3007) · Issue #3508 · symfony/symfony · GitHub
[go: up one dir, main page]

Skip to content

merged branch jmikola/logout-csrf (PR #3007) #3508

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

Closed
wizhippo opened this issue Mar 5, 2012 · 4 comments · Fixed by #3511
Closed

merged branch jmikola/logout-csrf (PR #3007) #3508

wizhippo opened this issue Mar 5, 2012 · 4 comments · Fixed by #3511

Comments

@wizhippo
Copy link
Contributor
wizhippo commented Mar 5, 2012

After merged branch jmikola/logout-csrf (PR #3007) I get the exception:

You cannot create a service ("request") of an inactive scope ("request").

when running any console command. The logoutUrl helper looks like it is looking for the request during cache warmup maybe as the error does not happen if yo turn of optional cache warm.

It also happens when running commands like router:debug

@Seldaek
Copy link
Member
Seldaek commented Mar 5, 2012

Ping @jmikola - I guess injecting the container in the helper is the only option here?

@maoueh
Copy link
Contributor
maoueh commented Mar 5, 2012

I can also confirm this problem. I was about to log an issue when I saw this one.

It is easy to test the issue by cloning symfony-standard, change symfony version in composer.lock to "source-reference": "294b57e1b15f28541444f667be5c98d90ab8c668" (offending commit), install dependencies with php composer.phar install and then run php app/console assetic:dump. This will raise the exception. Changing composer.lock to "source-reference": "af52362841119c6c5a2ef2930d3437252b02490d" (the commit just before the offending one), reinstalling the dependencies and running php app/console assetic:dump work this time.

Regards,
Matt

8000

@jmikola
Copy link
Contributor
jmikola commented Mar 6, 2012

Thanks for the repro steps, @maoueh. I'll look into this.

@fabpot fabpot closed this as completed in 8796276 Mar 6, 2012
homer6 pushed a commit to homer6/symfony that referenced this issue Mar 6, 2012
Commits
-------

8796276 [SecurityBundle] Avoid direct request dependency in LogoutUrlHelper

Discussion
----------

[SecurityBundle] Avoid direct request dependency in LogoutUrlHelper

This quickly addresses the problem when the helper is constructed in a console environment without request scope. Ideally, the helper should be able to construct the absolute logout URL using data already available in the UrlGenerator's RequestContext and the $_SERVER environment variable; however, that will require copying some code from the Request class to create a base URI and path.

Fixes symfony#3508

[![Build Status](https://secure.travis-ci.org/jmikola/symfony.png?branch=master)](http://travis-ci.org/jmikola/symfony)
@maoueh
Copy link
Contributor
maoueh commented Mar 6, 2012

@jmikola Thank you for your quick response time on this issue :)

Cheers,
Matt

4FCE
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

Successfully merging a pull request may close this issue.

5 participants
0