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

Web Content: Link to a document with a space in the document name fails



      Web Content: Link to a document with a space in the document name fails because the system will generate a "+" to fill in the gap. For example, if the document name is "George Washington.doc", it becomes "George+Washington.doc". This throws off the URL because the URL being passed something like this: /documents/10180/0/websphere+outline.odt. The work around is if the user replaces the + with %20, then the URL /documents/10180/0/websphere%20outline.odt, then the document can be retrieved.

      Steps to reproduce:
      1. Go to the Control Panel> Documents and Media.
      2. Upload two documents: one document has only one name while the other has a space in the name. (E.g. "test.doc" and "test test.doc")
      3. Go to the Control Panel> Web Content> Structures.
      4. Create the structure with the rows below:

      • Head
      • Image
      • Documents.
      • Body.

      5. Save the structure as Structure 1.
      6. Go to the Control Panel> Web Content> Templates.
      7. Select Structure 1 as the structure.
      8. Click Launch Editor for Velocity.
      9. Enter the following:

      <a href="${Documents.data}">Document Library Link</a>
      <img src="$Image.getData()"/>

      10. Save the template as Template 1.
      11. Add a page.
      12. Add the Web Content Display portlet.
      13. Add a new Web Content article.

      • Choose Structure 1/ Template 1.
      • Enter a title.
      • Enter content in the Content field.
      • Select an image.
      • Select the document with only one name from the Documents and Media portlet.
      • Publish

      14. Verify that the Document Library Link is correct by clicking the link and downloading the document.
      15. Edit the article.

      • Select the document with a space in the name.
      • In the URL field, there is a now a plus sign in the document name. (E.g. /documents/10180/0/websphere+outline.odt.) The original file name did not have the plus symbol (See screenshots.)
      • Publish the article.

      16. Click the document library link. This causes the system to crash and generate a No DLFileEntry exception (see log). This is expected because of the + in the file name. The user could remove the + or replace the + with %20 before publishing and leave the space in the URL field but the user should not have to take this step.


          Issue Links



              tammy.fong Tammy Fong (Inactive)
              justin.choi Justin Choi (Inactive)
              Participants of an Issue:
              Recent user:
              Marta Elicegui
              0 Vote for this issue
              3 Start watching this issue


                Days since last comment:
                9 years, 18 weeks, 1 day ago


                  Version Package
                  6.0.X EE
                  6.1.1 CE GA2
                  6.1.20 EE GA2
                  6.2.0 CE M2