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

Whitespace in portlet preference values not properly preserved on LAR export

    Details

    • Branch Version/s:
      6.0.x, 5.2.x
    • Backported to Branch:
      Committed

      Description

      To reproduce:

      1. Deploy the attached portlet and add it to a page ("Test Preferences").
      2. Enter "once upon a time" (two spaces between each word) into the text area and press "submit".
      3. Go to the Communities portlet in the control panel and export the pages of the community.
      4. Import the LAR generated into step 3.
      5. Navigate back to the page where you added the portlet.

      You will notice that the value in the text area is changed to "once upon a time" (one space between each word). This is due to a bug where the default pretty printer from DOM4J (which is used to format the XML exported to the LAR) trims whitespaces, causing Liferay to trim multiple space characters down to a single space character, so when the LAR is reimported, the extra spaces are lost.

      To address the issue, we should setTrimText to false before formatting the XML.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              sophia.zhang Sophia Zhang
              Reporter:
              minhchau.dang Minhchau Dang
              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:
                7 years, 32 weeks, 3 days ago

                  Packages

                  Version Package
                  5.2.X EE
                  6.0.12 EE
                  6.1.0 CE RC1