diff --git a/src/Symfony/Bundle/FrameworkBundle/Resources/config/session.xml b/src/Symfony/Bundle/FrameworkBundle/Resources/config/session.xml index 5aae3b4d9f..26f08f7889 100644 --- a/src/Symfony/Bundle/FrameworkBundle/Resources/config/session.xml +++ b/src/Symfony/Bundle/FrameworkBundle/Resources/config/session.xml @@ -13,8 +13,6 @@ - - @@ -37,10 +35,14 @@ - + + + - + + + %kernel.cache_dir%/sessions diff --git a/src/Symfony/Bundle/FrameworkBundle/Tests/Functional/Bundle/TestBundle/Controller/InjectedFlashbagSessionController.php b/src/Symfony/Bundle/FrameworkBundle/Tests/Functional/Bundle/TestBundle/Controller/InjectedFlashbagSessionController.php new file mode 100644 index 0000000000..20c33a17e4 --- /dev/null +++ b/src/Symfony/Bundle/FrameworkBundle/Tests/Functional/Bundle/TestBundle/Controller/InjectedFlashbagSessionController.php @@ -0,0 +1,36 @@ +flashBag = $flashBag; + $this->router = $router; + } + + public function setFlashAction(Request $request, $message) + { + $this->flashBag->add('notice', $message); + + return new RedirectResponse($this->router->generate('session_showflash')); + } +} diff --git a/src/Symfony/Bundle/FrameworkBundle/Tests/Functional/Bundle/TestBundle/Resources/config/routing.yml b/src/Symfony/Bundle/FrameworkBundle/Tests/Functional/Bundle/TestBundle/Resources/config/routing.yml index 08be59db08..d9c7986f42 100644 --- a/src/Symfony/Bundle/FrameworkBundle/Tests/Functional/Bundle/TestBundle/Resources/config/routing.yml +++ b/src/Symfony/Bundle/FrameworkBundle/Tests/Functional/Bundle/TestBundle/Resources/config/routing.yml @@ -18,6 +18,10 @@ session_setflash: path: /session_setflash/{message} defaults: { _controller: Symfony\Bundle\FrameworkBundle\Tests\Functional\Bundle\TestBundle\Controller\SessionController::setFlashAction } +injected_flashbag_session_setflash: + path: injected_flashbag/session_setflash/{message} + defaults: { _controller: TestBundle:InjectedFlashbagSession:setFlash} + session_showflash: path: /session_showflash defaults: { _controller: Symfony\Bundle\FrameworkBundle\Tests\Functional\Bundle\TestBundle\Controller\SessionController::showFlashAction } diff --git a/src/Symfony/Bundle/FrameworkBundle/Tests/Functional/SessionTest.php b/src/Symfony/Bundle/FrameworkBundle/Tests/Functional/SessionTest.php index ae8c7afafd..530492ab8b 100644 --- a/src/Symfony/Bundle/FrameworkBundle/Tests/Functional/SessionTest.php +++ b/src/Symfony/Bundle/FrameworkBundle/Tests/Functional/SessionTest.php @@ -69,6 +69,29 @@ class SessionTest extends AbstractWebTestCase $this->assertStringContainsString('No flash was set.', $crawler->text()); } + /** + * Tests flash messages work when flashbag service is injected to the constructor. + * + * @dataProvider getConfigs + */ + public function testFlashOnInjectedFlashbag($config, $insulate) + { + $client = $this->createClient(['test_case' => 'Session', 'root_config' => $config]); + if ($insulate) { + $client->insulate(); + } + + // set flash + $client->request('GET', '/injected_flashbag/session_setflash/Hello%20world.'); + + // check flash displays on redirect + $this->assertStringContainsString('Hello world.', $client->followRedirect()->text()); + + // check flash is gone + $crawler = $client->request('GET', '/session_showflash'); + $this->assertStringContainsString('No flash was set.', $crawler->text()); + } + /** * See if two separate insulated clients can run without * polluting each other's session data. diff --git a/src/Symfony/Bundle/FrameworkBundle/Tests/Functional/app/Session/config.yml b/src/Symfony/Bundle/FrameworkBundle/Tests/Functional/app/Session/config.yml index ad6bdb691c..4807c42d1e 100644 --- a/src/Symfony/Bundle/FrameworkBundle/Tests/Functional/app/Session/config.yml +++ b/src/Symfony/Bundle/FrameworkBundle/Tests/Functional/app/Session/config.yml @@ -5,3 +5,7 @@ services: Symfony\Bundle\FrameworkBundle\Tests\Functional\Bundle\TestBundle\Controller\SubRequestController: tags: - { name: controller.service_arguments, action: indexAction, argument: handler, id: fragment.handler } + + Symfony\Bundle\FrameworkBundle\Tests\Functional\Bundle\TestBundle\Controller\InjectedFlashbagSessionController: + autowire: true + tags: ['controller.service_arguments'] diff --git a/src/Symfony/Component/Validator/Resources/translations/validators.es.xlf b/src/Symfony/Component/Validator/Resources/translations/validators.es.xlf index 08ec74c05b..24ef5548da 100644 --- a/src/Symfony/Component/Validator/Resources/translations/validators.es.xlf +++ b/src/Symfony/Component/Validator/Resources/translations/validators.es.xlf @@ -192,7 +192,7 @@ No temporary folder was configured in php.ini. - Ninguna carpeta temporal fue configurada en php.ini. + Ninguna carpeta temporal fue configurada en php.ini o la carpeta configurada no existe. Cannot write temporary file to disk. diff --git a/src/Symfony/Component/Validator/Resources/translations/validators.pl.xlf b/src/Symfony/Component/Validator/Resources/translations/validators.pl.xlf index 5c1e472ab5..df93abd0b9 100644 --- a/src/Symfony/Component/Validator/Resources/translations/validators.pl.xlf +++ b/src/Symfony/Component/Validator/Resources/translations/validators.pl.xlf @@ -192,7 +192,7 @@ No temporary folder was configured in php.ini. - Nie skonfigurowano folderu tymczasowego w php.ini, lub skonfigurowany folder nie istnieje. + Nie skonfigurowano folderu tymczasowego w php.ini lub skonfigurowany folder nie istnieje. Cannot write temporary file to disk.