Uploaded image for project: 'Magnolia'
  1. Magnolia
  2. MAGNOLIA-6203

Inject the Context to ContextLocaleProvider

    XMLWordPrintable

Details

    • Improvement
    • Resolution: Fixed
    • Neutral
    • 5.4
    • None
    • None
    • None

    Description

      The current implementation of ContextLocaleProvider retrieves the Locale by calling the static MgnlContext.getLocale() method. This can cause issues when e.g translating notifications sent from a thread without MgnlContext set, e.g. triggered by JCR-Observation. (currently fails with IllegalStateException in MgnlContext.getInstance)

      Anything that gets a SimpleTranslator through injection (i.e which injects a LocaleProvider indirectly) will currently be using the Locale of whatever context is bound to thread where it tries to do the translation.

      If we injected the Context in ContextLocaleProvider instead, it'd be using the Locale corresponding to the context/thread where it was instantiated.

      Checklists

        Acceptance criteria

        Attachments

          Issue Links

            Activity

              People

                gjoseph Magnolia International
                ejervidalo Espen Jervidalo
                Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                  Created:
                  Updated:
                  Resolved:

                  Checklists

                    Task DoD