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

Breadcrumb link URL generation: no space before attributes starting with "data-"

    Details

      Description

      For breadcrumb which has "data-" attributes the generated html is not valid because there is no space between attributes. In the code you can see that it will generate something like <a href="hellourl"data-direction-right="true" instead of <a href="hellourl" data-direction-right="true". This doesn't seem to have any impact on the functionality because modern browsers can parse dirty HTML and XML, however, customer's custom extension code parses this html and this causes them problems. Additionally, according to the XML and HTML specifications there is a mandatory white space between attribute-value-end-quote and next attribute-name:

      https://www.w3.org/TR/html5/syntax.html#after-attribute-value-(quoted)-state
      https://www.w3.org/TR/2006/REC-xml11-20060816/#attdecls
      https://www.w3.org/TR/html5/dom.html#custom-data-attribute

      Repro steps:
      1. Go to Admin/Content/Documents and Media. Add a folder folder1, then click on it.
      2. There will be breadcrumb section on top: "Home/folder1".
      3. - Inspect element Home or;

      • view page source and look for breadcrumb or;
      • run in debug mode, put a breakpoint in html\taglib\ui\breadcrumb\display_style_horizontal.jsp and check variable "breadcrumbString"

      Result:
      HTML code for the Home link looks like this:
      <a href="http://localhost:8080/group/control_panel/manage?p_p_auth=FrfX0FkN&p_p_id=20&p_p_lifecycle=0&p_p_state=maximized&p_p_mode=view&doAsGroupId=20182&refererPlid=20185&controlPanelCategory=current_site.content&_20_struts_action=%2Fdocument_library%2Fview"data-direction-right="true" data-folder-id="0" >Home</a>
      There is no space between the href attribute and the data-direction-right attribute.
      Expected:
      There should be a space between them. It should look like this:
      <a href="http://localhost:8080/group/control_panel/manage?p_p_auth=FrfX0FkN&p_p_id=20&p_p_lifecycle=0&p_p_state=maximized&p_p_mode=view&doAsGroupId=20182&refererPlid=20185&controlPanelCategory=current_site.content&_20_struts_action=%2Fdocument_library%2Fview" data-direction-right="true" data-folder-id="0">Home</a>

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                felix.zhang Felix Zhang
                Reporter:
                zsolt.szabo Zsolt Szabo (Inactive)
                Participants of an Issue:
                Recent user:
                Esther Sanz
              • Votes:
                0 Vote for this issue
                Watchers:
                1 Start watching this issue

                Dates

                • Due:
                  Created:
                  Updated:
                  Resolved:
                  Days since last comment:
                  3 years, 37 weeks, 4 days ago

                  Packages

                  Version Package
                  6.2.X EE