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

Friendly URL Service picks the wrong route-definition, if multiple defnitions contain the same Parameters

    Details

    • Type: Bug
    • Status: Verified
    • Resolution: Unresolved
    • Affects Version/s: 7.4.0 CE GA1
    • Fix Version/s: None
    • Component/s: Friendly URL Service
    • Labels:
    • Fix Priority:
      3

      Description

      Given the following routes are defined in a friendly-Url Mapping-XML:

       

      <route>
          <pattern>/{manufacturerName}</pattern>
          <implicit-parameter name="mvcRenderCommandName">/</implicit-parameter>
          <implicit-parameter name="p_p_lifecycle">0</implicit-parameter>
          <implicit-parameter name="p_p_state">normal</implicit-parameter>
          <implicit-parameter name="p_p_mode">view</implicit-parameter>
      </route>
      <route>
          <pattern>/{nodeName}/{manufacturerName}</pattern>
          <implicit-parameter name="mvcRenderCommandName">/</implicit-parameter>
          <implicit-parameter name="p_p_lifecycle">0</implicit-parameter>
          <implicit-parameter name="p_p_state">normal</implicit-parameter>
          <implicit-parameter name="p_p_mode">view</implicit-parameter>
      </route>

       

      When i build a URL in a JSP with renderURL-Tag:

      <portlet:renderURL var="productsRenderUrl">
          <portlet:param name="mvcRenderCommandName" value="/"/>
          <portlet:param name="nodeName" value="someNode"/>
          <portlet:param name="manufacturerName" value="someManufacturer"/>
      </portlet:renderURL>

      I would expect that generated URL would match the pattern, that contains both, the "nodeName" and the "manufacturerName" Parameters. Instead the Tag generates the URL that only contains the "manufacturerName" and appends the nodeName as Query-Parameter.

      However, when I switch the order of the route-definitions, so that the pattern "/{nodeName}/{manufacturerName}" is defined first, the renderURL-Tag generates the correct friendly-URL.

      Experimenting with the route-definitions, I figured out that the first route-definition that matches ANY Parameter is used to build the URL. Instead the definition that matches ALL Parameters should be used.

       

        Attachments

          Activity

            People

            Assignee:
            support-lep@liferay.com SE Support
            Reporter:
            sebastian.glathe Sebastian Glathe
            Participants of an Issue:
            Recent user:
            Yvonne Han
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Dates

              Created:
              Updated:
              Days since last comment:
              26 weeks ago

                Packages

                Version Package