Skip to content

locale listener doc ./. example discrepancy #9164

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
kaiwa opened this issue Jan 29, 2018 · 1 comment
Closed

locale listener doc ./. example discrepancy #9164

kaiwa opened this issue Jan 29, 2018 · 1 comment
Labels
actionable Clear and specific issues ready for anyone to take them. bug good first issue Ideal for your first contribution! (some Symfony experience may be required) hasPR A Pull Request has already been submitted for this issue. Status: Needs Review
Milestone

Comments

@kaiwa
Copy link

kaiwa commented Jan 29, 2018

https://symfony.com/doc/master/translation/locale.html

The custom listener must be called before LocaleListener, which initializes the locale based on the current request. To do so, set your listener priority to a higher value than LocaleListener priority (which you can obtain running the debug:event kernel.request command).

And then in the linked example:

https://symfony.com/doc/master/session/locale_sticky_session.html

    public static function getSubscribedEvents()
    {
        return array(
            // must be registered after the default Locale listener
            KernelEvents::REQUEST => array(array('onKernelRequest', 15)),
        );
    }

Documentation says (in bold) the custom listener must be registered before the framework listener, the inline doc in the example says after, which is exactly the opposite.

@xabbuh xabbuh added bug good first issue Ideal for your first contribution! (some Symfony experience may be required) actionable Clear and specific issues ready for anyone to take them. labels Jan 29, 2018
@javiereguiluz javiereguiluz added the hasPR A Pull Request has already been submitted for this issue. label Jan 29, 2018
@javiereguiluz javiereguiluz added this to the 2.7 milestone Jan 29, 2018
javiereguiluz added a commit that referenced this issue Jan 29, 2018
…uiluz)

This PR was squashed before being merged into the 2.7 branch (closes #9168).

Discussion
----------

Fixed the priority of the sticky locale example

This fixes #9164.

Commits
-------

a859e36 Fixed the priority of the sticky locale example
@javiereguiluz
Copy link
Member

Fixed by #9168.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
actionable Clear and specific issues ready for anyone to take them. bug good first issue Ideal for your first contribution! (some Symfony experience may be required) hasPR A Pull Request has already been submitted for this issue. Status: Needs Review
Projects
None yet
Development

No branches or pull requests

4 participants