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

Module containing multiple portlets and resource bundles will always read from first

    Details

      Description

      Steps to reproduce:

      1. Create a module with two portlets
      2. For each portlet, create a different Language.properties on different paths
      3. Configure them each so that they read the different properties file
      4. Deploy the module
      5. Place both portlets on a page

      Expected result: The "Hello" message that they output are specific to the portlet that was just placed
      Actual result: Both portlets show the value of the language key from the resource bundle that was referenced by one of the portlets.

      Additional information

      • Multiple portlets per module seems perfectly fine
      • There's no indication that we couldn't use multiple resource bundles
      • Reproduced with de-54
      • Reproduced with 7.0.x (ea1ba50eec17aaf5c0f62e000a2421571fa8d151)
      • Reproduced on master (1bf78e4b6a189cb376a4c95cf62a7bee6714c9f3)

      Related Liferay source code:
      The resource bundle lookup is set up in TagResourceBundleUtil, which gets a ResourceBundleLoader using:

      resourceBundleLoader =
      	ResourceBundleLoaderUtil.
      		getResourceBundleLoaderByServletContextName(
      			servletContextName);

      Only the servlet context name is taken into account for resource bundle lookup.

      After investigation, we found that the portal should be able to handle a module with 2 separate portlets that use 2 separate Language.properties files, because this used to work in Liferay 6.2 due to the way we implemented the lookup in LanguageImpl.

      https://github.com/liferay/liferay-portal/blob/6.2.5-ga6/portal-impl/src/com/liferay/portal/language/LanguageImpl.java#L886-L905

        Attachments

          Activity

            People

            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:
                Days since last comment:
                1 year, 4 weeks, 5 days ago

                Packages

                Version Package
                7.0.0 DXP FP58
                7.0.0 DXP SP9
                7.0.X
                7.1.10 DXP FP2
                7.1.1 CE GA2
                7.1.10.1 SP1
                7.1.X
                Master