Skip to content

Commit

Permalink
#25797 include in 23.01.6
Browse files Browse the repository at this point in the history
  • Loading branch information
erickgonzalez committed Aug 30, 2023
1 parent 7794179 commit 4c0d563
Showing 1 changed file with 11 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -233,12 +233,18 @@ public void _saveFileAsset(ActionRequest req, ActionResponse res,PortletConfig c
contentlet.setStructureInode(selectedStructureInode);
contentlet.setHost(hostId);
contentlet.setFolder(folder.getInode());
final Object searchedLang= session.getAttribute(com.dotmarketing.util.WebKeys.LANGUAGE_SEARCHED);
if (UtilMethods.isSet(searchedLang)) {
final long langId = Long.parseLong(searchedLang.toString());
final long defaultLanguageId = APILocator.getLanguageAPI().getDefaultLanguage().getId();
contentlet.setLanguageId(langId == 0 ? defaultLanguageId : langId);
long contentLang = APILocator.getLanguageAPI().getDefaultLanguage().getId();
if (config.getPortletName().contains("site-browser")) {
if(UtilMethods.isSet(session.getAttribute(WebKeys.LANGUAGE_SEARCHED))) {
final long searchedLangId = Long.parseLong(session.getAttribute(WebKeys.LANGUAGE_SEARCHED).toString());
contentLang = searchedLangId > 0 ? searchedLangId : contentLang;
}
} else {
if(UtilMethods.isSet(session.getAttribute(WebKeys.CONTENT_SELECTED_LANGUAGE))) {
contentLang = Long.parseLong(session.getAttribute(WebKeys.CONTENT_SELECTED_LANGUAGE).toString());
}
}
contentlet.setLanguageId(contentLang);
String fileName = fileNamesArray[k];
String title = getFriendlyName(fileName);

Expand Down

0 comments on commit 4c0d563

Please sign in to comment.