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

PortalImpl getJournalArticleActualURL does not support non-ascii urlTitle

    Details

      Description

      • Create journal article with non-ascii title ("Всем привет")
      • Asset Publisher is configured to View content in Specific Portlet
      • Article's link is generated like localhost:8080/web/guest/-/всем-привет?redirect=...
      • Click the link and Journal Article is not displayed

      After some research we'found that the problem is in PortalImpl getJournalArticleActualURL method.
      urlTitle parsed from friendlyURL is not decoded and therefore JournalArticleLocalServiceUtil.getArticleByUrlTitle unable to find the Article. Here is our fix:

      public String getJournalArticleActualURL(
      long groupId, String mainPath, String friendlyURL,
      Map<String, String[]> params, Map<String, Object> requestContext)
      throws PortalException, SystemException {

      String articleUrlTitle = friendlyURL.substring(
      JournalArticleConstants.CANONICAL_URL_SEPARATOR.length());

      + try

      { + articleUrlTitle = URLDecoder.decode(articleUrlTitle, "UTF-8"); + }

      catch (UnsupportedEncodingException ex)

      { + _log.debug(ex.getMessage(), ex); + }

      JournalArticle journalArticle =
      JournalArticleLocalServiceUtil.getArticleByUrlTitle(
      groupId, articleUrlTitle);

        Attachments

          Activity

            People

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

              Dates

              • Created:
                Updated:
                Resolved:
                Days since last comment:
                6 years, 25 weeks ago

                Packages

                Version Package
                6.2.0 CE M4