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

When running on a non-ROOT context, download links for documents do not function correctly



      When Liferay DXP is running on a non-ROOT context the download links for documents generated by the documents and media portlet do not download the document when left-clicked, but instead open undecipherable text in the browser window. If the download link is control-clicked (to open it in a new tab) the download works as expected.

      It is failing because of some hard coded URL paths in the SPA init function. The code is telling the Javascript that intercepts all the link clicks to exclude "/documents" and "/images" paths. However, that does not work because it doesn't take into consideration the different web context. It should exclude "/[WEB_CONTEXT]/documents".

      Steps to Reproduce:
      In a clean Liferay DXP Bundle with DE-14 installed:
      1. Change the context of the portal from ROOT to 'xyz':
      A. Change the name of the ROOT directory to xyz.
      B. Change the name of /TOMCAT_HOME/conf/Catalina/localhost/ROOT.xml to 'xyz.xml'
      C. Add the "path" attribute to the Context tag in the newly named 'xyz.xml' as follows:

      <Context crossContext="true" path="/xyz">

      2. Ensure all changes are saved and start Liferay.
      3. Access the portal at localhost:8080/xyz
      4. Navigate to Menu > Content > Documents and Media
      5. Upload some documents of any file type (I used a .pdf)
      6. Click on the Document.
      7. Click on the 'Info' icon.
      8. Left-click on the Download link.

      Document is downloaded.
      Undecipherable text is loaded in the tab.


          Issue Links



              • Assignee:
                linda.sui Linda Sui
                joshua.cords Joshua Cords
                Participants of an Issue:
                Recent user:
                Csaba Turcsan
              • Votes:
                0 Vote for this issue
                2 Start watching this issue


                • Created:
                  Days since last comment:
                  2 years, 27 weeks, 4 days ago


                  Version Package
                  7.0.0 DXP FP20
                  7.0.3 CE GA4
                  7.0.0 DXP FP23
                  7.0.0 DXP SP4
                  7.0.X EE
                  7.0.4 CE GA5