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



      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




            lu.liu Lu Liu
            jorge.diaz Jorge Diaz
            Kiyoshi Lee Kiyoshi Lee
            Jorge Diaz Jorge Diaz
            0 Vote for this issue
            0 Start watching this issue


              1 year, 14 weeks, 5 days ago


                Version Package
                7.2.10 DXP FP14
       DXP SP5
       DXP SP3
                7.4.2 CE GA3 DXP 7,4
                7.4.13 DXP GA1