From 8bf503890e3005bd16ca520dc37827f9dbffffd6 Mon Sep 17 00:00:00 2001 From: cirrosol Date: Mon, 13 Nov 2017 11:27:25 +0200 Subject: [PATCH] Added getSubscribedEvents() to UserLocaleSubscriber The code wasn't working without this. --- session/locale_sticky_session.rst | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/session/locale_sticky_session.rst b/session/locale_sticky_session.rst index 4e89eb2ffc2..ba416e46099 100644 --- a/session/locale_sticky_session.rst +++ b/session/locale_sticky_session.rst @@ -144,6 +144,7 @@ event: use Symfony\Component\HttpFoundation\Session\SessionInterface; use Symfony\Component\Security\Http\Event\InteractiveLoginEvent; + use Symfony\Component\Security\Http\SecurityEvents; use Symfony\Component\EventDispatcher\EventSubscriberInterface; /** @@ -170,6 +171,13 @@ event: $this->session->set('_locale', $user->getLocale()); } } + + public static function getSubscribedEvents() + { + return array( + SecurityEvents::INTERACTIVE_LOGIN => array(array('onInteractiveLogin', 15)), + ); + } } If you're using the :ref:`default services.yml configuration `,