7.2.X, 7.3.X, Master
I have detected that we are using group.getAvailableLanguageIds() in the 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
- Create a site with two locales: English and Spanish. Set the Spanish as the default one.
- Create a content page and translate its name to both languages
- Go to your database and query the Group_ table
- Update the name of your site, manually remove the Spanish translation of the name
- Clean the database cache or restart your Liferay installation
- 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
- Try save it:
- : the save operation is executed correctly
- : an unexpected error is produced