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

Inject the Context to ContextLocaleProvider

XMLWordPrintable

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

      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.

        Acceptance criteria

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

                Created:
                Updated:
                Resolved:

                  Task DoD