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

Wrong method used to get the available locales of the site

    Details

      Description

      I have detected that we are using group.getAvailableLanguageIds() in the JSP:

      • modules/apps/layout/layout-admin-web/src/main/resources/META-INF/resources/layout/screen/navigation/entries/general.jsp

      to retrieve the available site locales, but we should use LanguageUtil.getAvailableLocales(group.getGroupId()) because:

      • group.getAvailableLanguageIds() returns the languages available in the group.name and group.description fields (used by Staging functionality)
      • LanguageUtil.getAvailableLocales(group.groupId()) returns the locales configured by the user in the site administration section (or inherited from the instance)

      I have detected this because two customers had some problems in this point in case the site has no name in the default language.
      I have been unable to reproduce the issue without manually changing the database, perhaps the inconsistent data that produces this issue can only be generated with old fixpacks, but as two customers has reported it, we should fix it.

      Steps to reproduce

      1. Create a site with two locales: English and Spanish. Set the Spanish as the default one.
      2. Create a content page and translate its name to both languages
      3. Go to your database and query the Group_ table
      4. Update the name of your site, manually remove the Spanish translation of the name
      5. Clean the database cache or restart your Liferay installation
      6. Edit the created page and click in the the paint roller icon to open "Page Design Options" => "More" => "Look and Feel". In some branches this paint roller icon will open the "Look and Feel" option directly
      7. Try save it:
        • Expected behavior: the save operation is executed correctly
        • Wrong behavior: an unexpected error is produced

        Attachments

          Activity

            People

            Assignee:
            lu.liu Lu Liu
            Reporter:
            jorge.diaz Jorge Diaz
            Participants of an Issue:
            Recent user:
            Tomáš Polešovský
            Engineering Assignee:
            Jorge Diaz
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:
              Days since last comment:
              16 weeks, 3 days ago

                Packages

                Version Package
                7.2.10 DXP FP14
                7.2.10.5 DXP SP5
                7.2.X
                7.3.X
                7.4.2 CE GA3 DXP 7,4
                Master