Uploaded image for project: 'PUBLIC - Liferay Portal Community Edition'
  1. PUBLIC - Liferay Portal Community Edition
  2. LPS-113165

Portal getLocale from session is not correct

Details

    Description

      After changing user language preferences or current language via language-selector portlet the

      getLocale(
      HttpServletRequest request, HttpServletResponse response, boolean initialize)

      method from Portal classes always returns the language set during the login.

       

      Step to reproduce, using Commerce for convinience:

      • login with user having en_US user language preferences
      • go to users->users and organizations and edit the current user language setting
        for example to french
      • create a new site based on the site template minium
      • Go to that new site and in the main widget page, create a new account (click Select and order -> view accounts -> add account)
      • Add any item to your cart from the site home page, there should be a new order available in commerce -> orders
      • go to commerce->orders, some elements will still be in english
      • try to change the language using the language selector portlet, using for example german
      • go to commerce->orders, again some elements will still be in english

       

      After debugging the Commerce code we found that the classes, where we use ThemeDisplay to get the current locale, always receive the locale corresponding to the login one.

      Debuggin some more we found that the PortalImpl class when calling the reported method, returns the wrong locale when retrieving it from the session.
      -------------
      *Following this workaround: *
      Looks like a problem about ThemeDisplay not updated after the language change.
      After loggin out and back in, the format is correct

      Before Logout

      After Logout

      Attachments

        Issue Links

          Activity

            People

              marco.leo Marco Leo
              luca.pellizzon Luca Pellizzon
              Summer Zhang Summer Zhang
              Votes:
              0 Vote for this issue
              Watchers:
              8 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:
                4 days ago

                Packages

                  Version Package
                  7.1.X