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

PortalUtil.getPlidFromFriendlyURL(companyId, friendlyURL) is possible to return 0 even if given parameters are valid

    Details

    • Type: Bug
    • Status: Closed
    • Resolution: Fixed
    • Affects Version/s: 5.2.3, 5.2.9 EE, 6.0.6 GA, 6.0.11 EE
    • Fix Version/s: 5.2.X EE, 6.0.12 EE
    • Labels:
    • Environment:
      Tomcat 7.0.14 + MySQL 5.1.56. Firefox 4.0.1 5.2.x Revision 82000.
      Tomcat 7.0.14 + MySQL 5.1.56. Firefox 4.0.1 6.0.x Revision 82000.
      Tomcat 7.0.14 + MySQL 5.1.56. Firefox 4.0.1 6.1.x Revision 82000.
    • Branch Version/s:
      6.0.x, 5.2.x
    • Backported to Branch:
      Committed

      Description

      PortalUtil.getPlidFromFriendlyURL(companyId, friendlyURL) is possible to return 0 even if given parameters are valid.
      For example, when 'friendlyURL' is '\web\mysite', the method will try to get the Layout with '\web\guest\1' to return plid.
      The problem is, '\1' seems only valid when the first created page in the group exists. So it's not always safe to try '\1'.

      Steps to reproduce:

      1) Add a community
      2) Add 2 page to created community
      3) Delete first created page
      4) Call PortalUtil.getPlidFromFriendlyURL(PortalInstances.getCompanyId(request), "/web/your-community")

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              tammy.fong Tammy Fong (Inactive)
              Reporter:
              ryan.wan Ryan Wan
              Participants of an Issue:
              Recent user:
              Esther Sanz
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:
                Days since last comment:
                9 years, 24 weeks, 5 days ago

                  Packages

                  Version Package
                  5.2.X EE
                  6.0.12 EE